Пример #1
0
    // Updates Dr. Leben drill behaviour
    public BehaviourResult UpdateBehaviour(Agent agent)
    {
        // Checks if Dr Leben script can be detected
        if (!lebenScript && (lebenScript = agent as InitialLeben) == null)
        {
            return(BehaviourResult.ERROR);
        }

        if (!m_rage && lebenScript.drillingStart)
        {
            Debug.Log("Drilling door");
            lebenScript.navAgent.updatePosition = false;
            lebenScript.navAgent.ResetPath();
            return(BehaviourResult.SUCCESS);
        }
        else if (m_rage && lebenScript.securityDrilling)
        {
            lebenScript.navAgent.updatePosition = false;
            Debug.Log("Security Drilling");
            lebenScript.navAgent.ResetPath();
            return(BehaviourResult.SUCCESS);
        }
        //if (lebenScript.panels.Count > 0)
        //{
        //    // Goes through each panel in the list and search for one that Dr. Leben can drill
        //    foreach (GameObject panel in m_panels)
        //    {
        //        if (LineOfSightCheck(panel, agent))
        //            return BehaviourResult.SUCCESS;
        //    }
        //}
        return(BehaviourResult.FAILURE);
    }
 // Use this for initialization
 void Start()
 {
     m_eventManager = FindObjectOfType <EventManager>();
     lebenScript    = FindObjectOfType <InitialLeben>();
 }