// Use this for initialization void Start() { direction = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), 0f); sn = this.GetComponent <PerlinShake>(); gameManager = GameObject.FindGameObjectWithTag("GameManager"); gm = gameManager.GetComponent <GameManager> (); }
void Start() { animator = GetComponent <Animator>(); rigidbody = GetComponent <Rigidbody2D>(); sprite = GetComponent <SpriteRenderer>(); GetComponent <PhantomTrail>().enabled = false; shake = GameObject.FindGameObjectWithTag("CameraShaker").GetComponent <PerlinShake> (); }
void InitInstance() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } }
// Use this for initialization void Start() { Reset(); rb.velocity = new Vector2(0, 0); GetComponent <Renderer>().enabled = false; dead = true; shake = GetComponent <PerlinShake>(); source = GetComponent <AudioSource>(); }
void Awake() { if (_instance == null) { //If I am the first instance, make me the Singleton _instance = this; } else { //If a Singleton already exists and you find //another reference in scene, destroy it! if (this != _instance) { Destroy(this.gameObject); } } }
void OnTriggerEnter2D(Collider2D other) { //Debug.Log("Game information: " + gameObject.name + " on enter triggered " + other.gameObject.name); switch (other.gameObject.tag) { case "Feather": featherCount++; Destroy(other.gameObject.transform.parent.gameObject); break; case "Bullet": break; case "End": //Application.LoadLevel(0); StartCoroutine(NextLevel()); break; default: PerlinShake shaker = Camera.main.GetComponent <PerlinShake>(); shaker.PlayShake(); break; } }
void Awake(){ instance = this; currentState = State.normal; localPosition = this.transform.localPosition; }
// Use this for initialization void Start() { perlinshake = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <PerlinShake>(); UIFunction = GameObject.FindGameObjectWithTag("UIManager").GetComponent <UIFunctions>(); }
void Awake(){ instance = this; currentState = State.normal; }