protected virtual void Start() { Faction startFaction = (Faction)System.Enum.Parse(typeof(Faction), tag); if (faction.GetType() != null) { faction = startFaction; } GameManager.allUnit.Add(this); aggression.Add(Faction.Blue, 20); aggression.Add(Faction.Green, 20); aggression.Add(Faction.Grey, 20); aggression.Add(Faction.Orange, 20); aggression.Add(Faction.Player, 21); aggression.Add(Faction.Red, 20); aggression.Add(Faction.White, 20); rigibody = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); sprite = GetComponentInChildren <SpriteRenderer>(); messageManager = GetComponentInChildren <MessageConvas>(); SaveStartLayers(); if (rigibody != null) { jumpForce = rigibody.mass * 3; } }
void Start() { hero = (Hero)FindObjectOfType(typeof(Hero)); messageConvas = (MessageConvas)FindObjectOfType(typeof(MessageConvas)); }