public override void InitializeAgent() { base.InitializeAgent(); m_AgentRb = GetComponent <Rigidbody>(); m_MyArea = area.GetComponent <PyramidArea>(); m_SwitchLogic = areaSwitch.GetComponent <PyramidSwitch>(); }
public override void InitializeAgent() { base.InitializeAgent(); agentRb = GetComponent <Rigidbody>(); myArea = area.GetComponent <PyramidArea>(); rayPer = GetComponent <RayPerception>(); switchLogic = areaSwitch.GetComponent <PyramidSwitch>(); }
void Start() { m_Area = gameObject.transform.parent.gameObject; //拿到parent物件:場景(AreaPB) m_AreaComponent = m_Area.GetComponent <PyramidArea>(); //拿到PyramidArea物件:在場景的script中 }
private void Start() { area = gameObject.transform.parent.gameObject; areaComponent = area.GetComponent <PyramidArea>(); }
void Start() { m_Area = gameObject.transform.parent.gameObject; m_AreaComponent = m_Area.GetComponent <PyramidArea>(); }