Beispiel #1
0
    public override void Awake()
    {
        base.Awake();
        Debug.Log("House::Awake()");
        mSpawnPoint = gameObject.transform.Find("BulletSpawnPoint").gameObject.transform.position;

        mHouseBulletScript = GetComponent <Bullet> ();

        mBAttackState = new BuildingAttackState(this);
        mBIdleState   = new BuildingIdleState(this);

        mAttackRangeCollider = gameObject.transform.Find("AttackRangeCollider").gameObject;
        mAttackRangeCollider.GetComponent <SphereCollider> ().radius = mAttackDistance / gameObject.transform.lossyScale.x;
        mAttackRange = mAttackRangeCollider.GetComponent <BuildingAttackRange> ();
    }
    public override void Awake()
    {
        base.Awake ();
        Debug.Log ("House::Awake()");
        mSpawnPoint = gameObject.transform.Find ("BulletSpawnPoint").gameObject.transform.position;

        mHouseBulletScript = GetComponent<Bullet> ();

        mBAttackState = new BuildingAttackState (this);
        mBIdleState = new BuildingIdleState (this);

        mAttackRangeCollider = gameObject.transform.Find ("AttackRangeCollider").gameObject;
        mAttackRangeCollider.GetComponent<SphereCollider> ().radius = mAttackDistance / gameObject.transform.lossyScale.x;
        mAttackRange = mAttackRangeCollider.GetComponent<BuildingAttackRange> ();
    }