EmbeddedSoft
Home
Portfolio
All APPs
Android
iOS
Windows
OSX
Blog
Develop
Code
Systems
Develop
FuelSpaceShip
Develop
AngryBots 2 Project
Develop
Neon Battleground performance
Code
APP update progress
Code
Big Apple APPs refresh.
Code
Fixing Arcadian bugs from level 3.
Systems
Corosync, Pacemaker and Ldirectord. HA Load balancer
Systems
When “local storage” is lost in XenServer
Systems
Corosync – Pacemeker boot bug with Debian 7.8
Video
About Us
Contact
Site Menu
Develop
FuelSpaceShip
Code
APP update progress
Code
Big Apple APPs refresh.
Code
Fixing Arcadian bugs from level 3.
Code
Fixing Enemy Spider on Unity 5
Code
UltimateJoystick and AngryBots
Develop
AngryBots 2 Project
Develop
Neon Battleground performance
Develop
Porting Neon Battleground
Destroy by boundary in Unity
Written by:
ranko
-
Category:
Develop
ranko
using UnityEngine;
using System.Collections;
public class DestroyByBoundary : MonoBehaviour
{
private PlayerController playerController;
private PlayGui playGui;
void Start()
{
//////
GameObject playerControllerObject = GameObject.FindWithTag (“Player”);
if (playerControllerObject != null)
{
playerController = playerControllerObject.GetComponent <PlayerController>();
//Debug.Log (“I did find ‘Player’ script”);
}
if (playerController == null)
{
Debug.Log (“Cannot find ‘Player’ script”);
}
//////
//////
GameObject gameControllerObject = GameObject.FindWithTag (“GuiElement”);
if (gameControllerObject != null)
{
playGui = gameControllerObject.GetComponent <PlayGui>();
// Debug.Log (“I did find ‘PlayGui’ script”);
}
if (playGui == null)
{
Debug.Log (“Cannot find ‘PlayGui’ script”);
}
//////
}
void OnTriggerEnter(Collider other)
{
Instantiate (playerController.explosionPlayer, playerController.player.transform.position, playerController.player.transform.rotation);
Destroy (playerController.player.gameObject);
Instantiate (playerController.explosion, transform.position, transform.rotation);
other.gameObject.SetActive (false);
playGui.ShowBondryDestroyMenu();
playGui.HideElements();
}
}
February 26, 2015
Previous Post
Camera Orbit C# Unity
Next Post
Simple GUI script in Unity
Add your comment
Cancel reply
Your email address will not be published.
Home
Develop
Destroy by boundary in Unity
LIVE NOW! CLICK TO VIEW.
CURRENTLY OFFLINE
Add your comment