コード例 #1
0
    // Use this for initialization
    void Awake()
    {
        myUnit    = this.GetComponent <UnitState>();
        myAnim    = this.GetComponent <EnemyAnimControl>();
        beamRifle = this.GetComponentInChildren <UseBeamRifle>();
        myHealth  = this.GetComponent <EnemyHealth>();

        if (enemyType == 1)
        {
            randSkill = 2;
        }
        if (enemyType == 2)
        {
            randSkill = 1;
        }
    }
コード例 #2
0
    void Awake()
    {
        myAnim     = GameObject.FindGameObjectWithTag("Player").GetComponent <AnimatorControl>();
        ForeSprite = this.transform.Find("Foreground").GetComponent <UISprite>();

        if (btnType == 0)
        {
            beamRifle = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <UseBeamRifle>();
        }
        else if (btnType == 1)
        {
            multiLaser = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <MultiTargetLaser>();
        }
        else
        {
            myUnitState = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <UnitState>();
        }
    }