CreatureAttributes GetAttr() { if (_attr == null) { _attr = GetComponent <CreatureAttributes>(); } return(_attr); }
/// <summary> /// Clones attributes from source creature /// </summary> /// <param name="source">Source creature to copy attributes from</param> public void CloneAttributes(CreatureAttributes source) { velocity = source.Velocity; sightRadius = source.SightRadius; startingEnergy = source.StartingEnergy; Size = source.Size; generation = source.Generation + 1; }
private void OnSceneGUI() { attr = target as CreatureAttributes; Handles.color = Color.red; Handles.DrawWireArc(attr.transform.position, Vector3.forward, Vector3.right, 360, attr.SightRadius); if (attr.TargetFood != null) { Handles.DrawWireArc(attr.TargetFood.transform.position, Vector3.forward, Vector3.right, 360, 1); } }
// Use this for initialization void Start() { _attr = GetComponent <CreatureAttributes>(); ResetTime(); }