コード例 #1
0
    public override GameObject create()
    {
        GameObject        gameObject        = Instantiate(weaponPrefab);
        WeaponController  weaponController  = gameObject.GetComponent <WeaponController> ();
        MultiBulletWeapon multiBulletWeapon = gameObject.GetComponent <MultiBulletWeapon> ();

        multiBulletWeapon.attacksNumber  = attacksNumber;
        multiBulletWeapon.attackCost     = attackCost;
        multiBulletWeapon.attackDistance = attackDistance;
        multiBulletWeapon.incentive      = incentive;
        multiBulletWeapon.angle          = angle;
        multiBulletWeapon.bulletsNumber  = bulletsNumber;

        weaponController.BulletSpeed = bulletSpeed;
        weaponController.Damage      = attackDemage;
        weaponController.FireDelay   = attackDelay;

        return(gameObject);
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        animation = transform.FindDeepChild("Azazel").GetComponent <BossAnimation>();
        stats     = GetComponent <Stats>();
        agent     = GetComponent <NavMeshAgent>();
        weapon    = GetComponent <Weapon>();
        weapon2   = GetComponent <MultiBulletWeapon>();
        player    = GameObject.FindGameObjectWithTag("Player");
        ChangeState(AttackMode.Idle, MovementState.Idle);
        stageCombinationCount = Stages[0].ModeCombinations.Count;
        eyes = transform.FindDeepChild("LaserEyes").GetComponent <LaserEyes>();

        GameObject area = GameObject.FindGameObjectWithTag("BossArea");

        GameObject[] MinionSpawnPoints = GameObject.FindGameObjectsWithTag("MinionSpawn");
        MinionSpawns = new MinionSpawn[MinionSpawnPoints.Length];
        int count = 0;

        foreach (GameObject go in MinionSpawnPoints)
        {
            MinionSpawns[count] = go.GetComponent <MinionSpawn>();
            count++;
        }
    }