Пример #1
0
        // Use this for initialization
        void Start()
        {
            player = FindObjectOfType<PlayerActions>();
            name = gameObject.name;
            invokeCircle = transform.FindChild("Invoke Circle").gameObject;

            //spriteCircle = invokeCircle.GetComponent<SpriteRenderer>();
            invokeCircle.SetActive(false);
            anim = GetComponent<Animator>();
            enemyText = transform.FindChild("Canvas Enemy").GetComponentInChildren<Text>();
            enemyText.text = eName.ToLower();
            enemyText.font = GameManager.instance.weird_Font;

            sprRefColor = GetComponent<SpriteRenderer>().color;

            imp1ColorRef = transform.FindChild("imp1").GetComponent<SpriteRenderer>().color;
            imp2ColorRef = difficult == GameMode.easy ? imp2ColorRef = Color.white : imp2ColorRef = transform.FindChild("imp2").GetComponent<SpriteRenderer>().color; ;

            imp1Ref = transform.FindChild("imp1");
            if (difficult == GameMode.normal)
                imp2Ref = transform.FindChild("imp2");

            colliderRef = GetComponent<CircleCollider2D>();
            /*
            
            lastPlayerPos = player.transform.position;
            journeyLength = Vector3.Distance(transform.position, player.transform.position);
            startTime = Time.time;
            move_flag = false;
            playerNearby_flag = false;*/
        }
Пример #2
0
		// Use this for initialization
		void Start () {
			player = FindObjectOfType<PlayerActions>();
			name = gameObject.name;
			invokeCircle = transform.FindChild("Invoke Circle").gameObject;

			//spriteCircle = invokeCircle.GetComponent<SpriteRenderer>();
			invokeCircle.SetActive (false);
			anim = GetComponent<Animator> ();
			enemyText = transform.FindChild ("Canvas Enemy").GetComponentInChildren<Text> ();
			enemyText.text = eName.ToUpper ();
			enemyText.font = GameManager.instance.readable_Font;

			sprRefColor = GetComponent<SpriteRenderer>().color;
            /*
            
            lastPlayerPos = player.transform.position;
            journeyLength = Vector3.Distance(transform.position, player.transform.position);
            startTime = Time.time;
            move_flag = false;
            playerNearby_flag = false;*/
		}
Пример #3
0
		//Singlenton pattern
		void awake(){
			if (instance == null)
				instance = this;
			else if (instance != null)
				Destroy (this);
		}
Пример #4
0
		// Use this for initialization
		void Start () {
			//rb2d = GetComponent<Rigidbody2D>();
			anim = GetComponent<Animator>();
			transform.localScale = new Vector2 (playerScale, playerScale);
			paRef = FindObjectOfType<PlayerActions>();
		}