Exemple #1
0
    public virtual void Awake()
    {
        Debug.Log("Soldier's Position = " + gameObject.transform.position);

        /*
         * if (mST == SoldierType.E_ZOMBUNNY) {
         *      mAnim = GetComponent<Animator>();
         * }
         */

        mHPText = gameObject.transform.Find("HealthText").gameObject.GetComponent <TextMesh> ();
        if (mHPText == null)
        {
            Debug.Log("mHPText == null");
        }
        mHPText.text = "HP: " + mSHP;

        mAnim = GetComponent <Animator>();

        mSeeker = GetComponent <Seeker> ();

        //mController = GetComponent<CharacterController> ();

        mSAttackState = new SoldierAttackState(this);

        mSMoveState = new SoldierMoveState(this);

        mSDeadState = new SoldierDeadState(this);

        mAttackablePositions = new Vector3[8];
    }
Exemple #2
0
    public virtual void Awake()
    {
        Debug.Log("Soldier's Position = " + gameObject.transform.position);

        /*
         * if (mST == SoldierType.E_ZOMBUNNY) {
         *      mAnim = GetComponent<Animator>();
         * }
         */

        mHPText = gameObject.transform.Find("HealthText").gameObject.GetComponent <TextMesh> ();
        if (mHPText == null)
        {
            Debug.Log("mHPText == null");
        }
        mHPText.text = "HP: " + mSHP;

        mAnim = GetComponent <Animator>();

        mSeeker = GetComponent <Seeker> ();

        //mController = GetComponent<CharacterController> ();

        mSAttackState = new SoldierAttackState(this);

        mSMoveState = new SoldierMoveState(this);

        mSDeadState = new SoldierDeadState(this);

        mAttackablePositions = new Vector3[8];

        mGameType = ObjectType.EOT_SOLDIER;
        Debug.Log("Soldier::Awake() mGameType = " + mGameType);

        mDetectionRangeCollider = gameObject.transform.Find("AttackRangeCollider").gameObject;
        mDetectionRangeCollider.GetComponent <SphereCollider> ().radius = mDetectionDistance;
        Debug.Log("DetectionDistance = " + mDetectionDistance);
        mDetectionRange = mDetectionRangeCollider.GetComponent <SoldierDetectRange> ();
    }
    public virtual void Awake()
    {
        Debug.Log("Soldier's Position = " + gameObject.transform.position);
        /*
        if (mST == SoldierType.E_ZOMBUNNY) {
            mAnim = GetComponent<Animator>();
        }
        */

        mHPText = gameObject.transform.Find ("HealthText").gameObject.GetComponent<TextMesh> ();
        if (mHPText == null) {
            Debug.Log("mHPText == null");
        }
        mHPText.text = "HP: " + mSHP;

        mAnim = GetComponent<Animator>();

        mSeeker = GetComponent<Seeker> ();

        //mController = GetComponent<CharacterController> ();

        mSAttackState = new SoldierAttackState (this);

        mSMoveState = new SoldierMoveState (this);

        mSDeadState = new SoldierDeadState (this);

        mAttackablePositions = new Vector3[8];
    }
    public virtual void Awake()
    {
        Debug.Log("Soldier's Position = " + gameObject.transform.position);
        /*
        if (mST == SoldierType.E_ZOMBUNNY) {
            mAnim = GetComponent<Animator>();
        }
        */

        mHPText = gameObject.transform.Find ("HealthText").gameObject.GetComponent<TextMesh> ();
        if (mHPText == null) {
            Debug.Log("mHPText == null");
        }
        mHPText.text = "HP: " + mSHP;

        mAnim = GetComponent<Animator>();

        mSeeker = GetComponent<Seeker> ();

        //mController = GetComponent<CharacterController> ();

        mSAttackState = new SoldierAttackState (this);

        mSMoveState = new SoldierMoveState (this);

        mSDeadState = new SoldierDeadState (this);

        mAttackablePositions = new Vector3[8];

        mGameType = ObjectType.EOT_SOLDIER;
        Debug.Log ("Soldier::Awake() mGameType = " + mGameType);

        mDetectionRangeCollider = gameObject.transform.Find ("AttackRangeCollider").gameObject;
        mDetectionRangeCollider.GetComponent<SphereCollider> ().radius = mDetectionDistance;
        Debug.Log ("DetectionDistance = " + mDetectionDistance);
        mDetectionRange = mDetectionRangeCollider.GetComponent<SoldierDetectRange> ();
    }
Exemple #5
0
    public virtual void Awake()
    {
        Utility.Log("Soldier's Position = " + gameObject.transform.position);

        mHPText = gameObject.transform.Find("HealthText").gameObject.GetComponent<TextMesh>();
        if (mHPText == null)
        {
            Utility.Log("mHPText == null");
        }
        mHPText.text = "HP: " + mSHP;

        mAnim = GetComponent<Animator>();

        mSeeker = GetComponent<Seeker>();

        mSAttackState = new SoldierAttackState(this);

        mSMoveState = new SoldierMoveState(this);

        mSDeadState = new SoldierDeadState(this);

        mAttackablePositions = new Vector3[8];

        mGameType = ObjectType.EOT_SOLDIER;
        Utility.Log("Soldier::Awake() mGameType = " + mGameType);

        mDetectionRangeCollider = gameObject.transform.Find("AttackRangeCollider").gameObject;
        mDetectionRangeCollider.GetComponent<SphereCollider>().radius = mDetectionDistance;
        Utility.Log("DetectionDistance = " + mDetectionDistance);
        mDetectionRange = mDetectionRangeCollider.GetComponent<SoldierDetectRange>();

        mAStarPath = null;

        mAStarPathIndexList = null;

        mFinalMovePosition = new Vector3();

        mShortestPathObject = null;

        mPathsInfo = new List<Pair<int, SearchAStar.PathInfo>>(5);

        mOriginalPathObject = null;

        mDir = new Vector3();

        mNewposition = new Vector3();
    }