// Use this for initialization void Start() { life = GetComponent <LifebarController> (); rb = gameObject.GetComponent <Rigidbody2D> (); animation = GetComponent <SelfAnimated> (); tentacle.SetActive(false); GameObject t = null; if (mode == 1) { t = GameObject.Instantiate(dashTentaclePrefab); } if (mode == 2) { t = GameObject.Instantiate(attackTentaclePrefab); } if (mode == 3) { t = GameObject.Instantiate(shieldTentaclePrefab); } if (t != null) { t.transform.parent = this.transform; t.GetComponent <TentacleMouseControl> ().enabled = false; tentacleAnim = t.GetComponent <TentacleAnimation> (); tentacleAnim.BuildTentacle(); t.transform.localPosition = Vector3.zero; t.transform.localScale = Vector3.one; } }
// Use this for initialization void Start() { rb = gameObject.GetComponent <Rigidbody2D>(); audioSource = GetComponent <AudioSource>(); anim = GetComponent <SelfAnimated>(); paused = false; canJump = false; hasShield = false; hasTentacle = false; tentacleAnims = gameObject.GetComponentsInChildren <TentacleAnimation>(); foreach (TentacleAnimation a in tentacleAnims) { Debug.Log(a.gameObject); } }