private void Awake() { unitRigidBody2D = ((Unit_)owner).rigidbody2D_; stats_ = (UnitStats_)((Unit_)owner).mechanics_.stats_; unitAnimator = GetUnitAnimator(); inventory_ = (UnitInventory_)((Unit_)owner).inventory_; target = owner.transform.position; }
public void Awake() { allUnits = FindObjectsOfType <Unit_>().ToList(); allUnits.ForEach(unit => relationships.Add(new Relationship(unit, GetRelationShipLevel(unit)))); /* * Player_ player = FindObjectOfType<Player_>(); * relationships.Add(new Relationship((Unit_)owner, 1)); * relationships.Add(new Relationship(player, -1)); */ inventory = GetComponentInParent <Unit_>().gameObject.GetComponentInChildren <UnitInventory_>(); }