void Start() { controll = GetComponent <CharacterController>(); autoAreach = GetComponent <AutoAreach>().Init(controll); info = GetComponent <AbstractInfo>() as MosterInfo; info.autoAreachState = EnumAutoAreach.Patrol; info.targetArray = GameObject.Find("block").GetComponentsInChildren <Transform>(); }
public AutoAreach Init(CharacterController controller) { this.controller = controller; mosterInfo = GetComponent <MosterInfo>(); speed = mosterInfo.speed; maxSpeed = speed * 2; return(this); }