コード例 #1
0
    // Use this for initialization
    void Start()
    {
        ai         = GetComponent <IAstarAI>();
        machine    = GetComponent <AIStateMachine>();
        predator   = null;
        fleeSounds = GetComponent <FleeSounds>();

        exclamationMark = (GameObject)Instantiate(Resources.Load("Exclamation Mark"));
        exclamationMark.transform.parent     = this.transform;
        exclamationMark.transform.localScale = new Vector3(0.75f, 0.75f, 1.0f);
        exclamationMark.SetActive(false);
        InvokeRepeating("CheckIfFleeing", 0.0f, rate);
    }
コード例 #2
0
    void Start()
    {
        ai         = GetComponent <IAstarAI>();
        machine    = GetComponent <QuestAIStateMachine>();
        predator   = null;
        fleeSounds = GetComponent <FleeSounds>();

        homePosition = GameObject.Find("Priest Spawn").GetComponent <Collider2D>().bounds.center.AsVector2();

        exclamationMark = (GameObject)Instantiate(Resources.Load("Exclamation Mark"));
        exclamationMark.transform.parent = this.transform;
        exclamationMark.SetActive(false);
        exclamationMark.transform.localScale = new Vector3(0.75f, 0.75f, 1.0f);
        InvokeRepeating("CheckIfEvading", 0.0f, rate);
    }