コード例 #1
0
 public void BossDie()
 {
     finalBubbleEffect.SetActive(false);
     finalShieldEffect.SetActive(false);
     Singleton_Service.GetSingleton <GameMusic>().PlayCreditsMusic();
     gameObject.SetActive(false);
 }
コード例 #2
0
 void OnTriggerStay(Collider other)
 {
     if (IPL == null)
     {
         IPL = Singleton_Service.GetSingleton <Input_Listeners>();
     }
 }
コード例 #3
0
 void Start()
 {
     swordUI = Singleton_Service.GetSingleton <SwordUI>();
     IPL     = Singleton_Service.GetSingleton <Input_Listeners>();
     rb      = GetComponent <Rigidbody>();
     //StartCoroutine("CheckShurikenParent");
 }
コード例 #4
0
    // Use this for initialization
    void Start()
    {
        //finalChest.SetActive(false);
        anim  = GetComponent <Animator>();
        Rings = GameObject.FindGameObjectWithTag("Rings");
        for (int i = 0; i < Rings.transform.childCount; i++)
        {
            teleportPositions.Add(Rings.transform.GetChild(i));
        }
        //FOR TESTING

        /*foreach (Transform thing in teleportPositions)
         * {
         *  teleportPositions.Remove(thing);
         * }
         * teleportPositions.Add(Rings.transform.GetChild(0));*/



        tempBossShield = Instantiate(bossShield, transform);
        tempBossShield.transform.localPosition = new Vector3(0, 0.7f, 0.5f);
        tempBossShield.transform.localRotation = Quaternion.Euler(0, -90, 0);
        scene = Singleton_Service.GetSingleton <SceneController>();

        /*tempPresenceEffect = Instantiate(bossPresenceEffect, transform);
         * tempPresenceEffect.transform.localPosition = Vector3.zero;*/
    }
コード例 #5
0
 // Use this for initialization
 void Start()
 {
     IPL        = Singleton_Service.GetSingleton <Input_Listeners>();
     trackedObj = GetComponent <SteamVR_TrackedObject>();
     device     = SteamVR_Controller.Input((int)trackedObj.index);
     rb         = rotateParent.GetComponent <Rigidbody>();
 }
コード例 #6
0
 public Idle_State(Enemy_State_Pattern enemy_State_Pattern)
 {
     enemy     = enemy_State_Pattern;
     anim      = enemy.GetComponent <Animator>();
     player    = Singleton_Service.GetSingleton <Player>();
     rightHand = Singleton_Service.GetSingleton <RightHand>();
 }
コード例 #7
0
    // Use this for initialization
    void Start()
    {
        waitTime = 0.02f;

        scene     = Singleton_Service.GetSingleton <SceneController>();
        player    = Singleton_Service.GetSingleton <Player>();
        rightHand = Singleton_Service.GetSingleton <RightHand>();
        leftHand  = Singleton_Service.GetSingleton <LeftHand>();
        music     = Singleton_Service.GetSingleton <GameMusic>();

        swordSource     = rightHand.GetSword().GetComponent <AudioSource>();
        swordAud        = rightHand.GetSword().GetComponent <SwordAudio>();
        shieldSource    = leftHand.GetShield().GetComponent <AudioSource>();
        shieldAud       = leftHand.GetShield().GetComponent <ShieldAudio>();
        playerHitSource = player.GetComponent <AudioSource>();
        playerHitAud    = player.GetComponent <PlayerHitAudio>();


        playerAttack  = player.GetAttack();
        playerDefense = player.GetDefense();

        anim = GetComponent <Animator>();



        UpdateEnemyUI();

        EnemyInit();
        StartCoroutine("Updating");
        currentState = idleState;
        currentState.StartState();
    }
コード例 #8
0
    // Use this for initialization
    void Start()
    {
        wave = 0;

        //PlayerPrefs.SetInt("HighScore", 1);
        GM = Singleton_Service.GetSingleton <GameManager>();
        possibleSpawnPoints.Add(this.transform);
        StartCoroutine("SpawnEnemies");
        level = PlayerPrefs.GetInt("Level");
        if (level > PlayerPrefs.GetInt("HighScore"))
        {
            PlayerPrefs.SetInt("HighScore", level);
        }
        bruteThreshhold    = level * 1;
        levelAdjust        = level - 1;
        levelText.text     = "Level " + level;
        highscoreText.text = "High Score: Level " + PlayerPrefs.GetInt("HighScore");

        enemiesThisLevel += enemiesToSpawnScalar * levelAdjust;
        spawnDelay        = 25 - levelAdjust * 5;
        if (spawnDelay < 10)
        {
            spawnDelay = 10;
        }
        GM.announcer.PlaySound((30 - spawnDelay) / 5);
    }
コード例 #9
0
 // Use this for initialization
 void Start()
 {
     SED        = Singleton_Service.GetSingleton <ScannerEffectDemo>();
     bulletTime = Singleton_Service.GetSingleton <Gun>();
     StartCoroutine("BulletDeath");
     StartCoroutine("bulletLifespan");
 }
コード例 #10
0
 // Use this for initialization
 void Start()
 {
     IPL = Singleton_Service.GetSingleton <Input_Listeners>();
     WarningText.SetActive(false);
     switchTime = false;
     StartCoroutine("SwitchToFire");
 }
コード例 #11
0
 public Die_State(Enemy_State_Pattern enemy_State_Pattern)
 {
     enemy  = enemy_State_Pattern;
     anim   = enemy.GetComponent <Animator>();
     player = Singleton_Service.GetSingleton <Player>();
     scene  = Singleton_Service.GetSingleton <SceneController>();
 }
コード例 #12
0
    IEnumerator GetReady()
    {
        yield return(new WaitForSeconds(2f));

        rightHand = Singleton_Service.GetSingleton <RightHand>();
        isReady   = true;
    }
コード例 #13
0
    // Use this for initialization
    void Start()
    {
        //temporary testing
        PlayerPrefs.SetInt("currentLevel", 14);


        player = Singleton_Service.GetSingleton <Player>();
        music  = Singleton_Service.GetSingleton <GameMusic>();

        buildingLevels.Add(level1);
        for (int i = 1; i < 10; i++)
        {
            buildingLevels.Add(Instantiate(level, new Vector3(0, i * floorHeight, 0), Quaternion.identity, levels));
        }
        for (int i = 11; i <= 13; i++)
        {
            buildingLevels.Add(Instantiate(highLevel, new Vector3(0, (i - 1) * floorHeight, 0), Quaternion.identity, levels));
        }
        buildingLevels.Add(Instantiate(topLevel, new Vector3(0, 52, 0), Quaternion.identity, levels));
        foreach (int i in emptyLevels)
        {
            buildingLevels[i - 1].tag = "EmptyLevel";
            buildingLevels[i - 1].transform.Find("EnemyScrollPos").gameObject.SetActive(false);
            buildingLevels[i - 1].transform.Find("EnemyScroll").gameObject.SetActive(false);
            buildingLevels[i - 2].transform.Find("Ceiling").gameObject.SetActive(false);
        }
        currentMovableTile = Instantiate(movableTile, new Vector3(0, 0, -3f), Quaternion.identity);
        PutCrates();

        music.PlayStartingMusic();
        GetComponent <ScreenFader>().fadeIn = false;
        StartCoroutine(GetComponent <ScreenFader>().DoFade());
        StartCoroutine("DelayFadeIn");
        //currentPlayerScroll = Instantiate(playerScrollPos, Vector3.zero, Quaternion.identity);
    }
コード例 #14
0
 // Use this for initialization
 void Start()
 {
     maxScale = 0.15f;
     minScale = 0.11f;
     scene    = Singleton_Service.GetSingleton <SceneController>();
     player   = Singleton_Service.GetSingleton <Player>();
     StartCoroutine("Charge");
 }
コード例 #15
0
    public void Start()
    {
        IPL         = Singleton_Service.GetSingleton <Input_Listeners>();
        playerSword = Singleton_Service.GetSingleton <SwordUI>();
        type        = "Fire";

        thisCollider = GetComponent <BoxCollider>();
    }
コード例 #16
0
 // Use this for initialization
 void Start()
 {
     scene        = Singleton_Service.GetSingleton <SceneController>();
     currentLevel = scene.GetCurrentLevel();
     numGems      = PlayerPrefs.GetInt("numGems");
     numDeaths    = PlayerPrefs.GetInt("NumDeaths");
     UpdatePlayerUI();
 }
コード例 #17
0
 // Use this for initialization
 void Start()
 {
     player      = Singleton_Service.GetSingleton <Player>();
     scene       = Singleton_Service.GetSingleton <SceneController>();
     destination = GameObject.Find("DestinationGem");
     deltaPos    = (destination.transform.position - transform.position) / 50f;
     StartMoving();
 }
コード例 #18
0
 // Use this for initialization
 void Start()
 {
     if (PlayerPrefs.GetInt("hasPlayed") == 0)
     {
         gameObject.GetComponent <Button>().interactable = false;
     }
     door = Singleton_Service.GetSingleton <FrontDoor>();
 }
コード例 #19
0
 void Start()
 {
     swordUI = Singleton_Service.GetSingleton <SwordUI>();
     IPL     = Singleton_Service.GetSingleton <Input_Listeners>();
     rb      = GetComponent <Rigidbody>();
     this.GetComponent <CapsuleCollider>().isTrigger = true;
     swordSource = GetComponent <AudioSource>();
 }
コード例 #20
0
 // Use this for initialization
 void Start()
 {
     IPL       = Singleton_Service.GetSingleton <Input_Listeners>();
     active    = true;
     text.text = "Hellooo!!";
     activate(false);
     right = hand.GetComponent <Right_VR_Cont>();
     left  = hand.GetComponent <Left_VR_Cont>();
 }
コード例 #21
0
ファイル: BossGM.cs プロジェクト: ckusuma/Flaming-Ninja-Code
 void Start()
 {
     enemyBirds     = new List <BirdStatePattern>();
     OnSummon       = new UnityEvent();
     swordUI        = Singleton_Service.GetSingleton <SwordUI>();
     playerPosition = GameObject.FindGameObjectWithTag("Player Position").transform;
     UpdateBossUI();
     StartCoroutine("BossBehavior");
 }
コード例 #22
0
ファイル: GM.cs プロジェクト: ckusuma/Flaming-Ninja-Code
 private void Start()
 {
     swordUI    = Singleton_Service.GetSingleton <SwordUI>();
     enemyBirds = new List <BirdStatePattern>();
     if (spawnPoints != null && birdPrefab != null)
     {
         StartCoroutine("SpawnFlyingEnemies");
     }
 }
コード例 #23
0
 // Use this for initialization
 void Start()
 {
     IPL           = Singleton_Service.GetSingleton <Input_Listeners>();
     IPL.rightHand = GetComponent <NVRHand>();
     trackedObj    = GetComponent <SteamVR_TrackedObject>();
     ringDisplay   = IPL.rightRingDisplay;
     source        = GetComponent <AudioSource>();
     Invoke("LateStart", 2f);
 }
コード例 #24
0
    // Use this for initialization
    void Start()
    {
        switch (upgradeType)
        {
        case UpgradeType.Health:
            if (PlayerPrefs.GetInt("healthUpgrade") == 0)
            {
                PlayerPrefs.SetInt("healthUpgrade", 500);
                value = 500;
            }
            else
            {
                value = PlayerPrefs.GetInt("healthUpgrade");
            }
            break;

        case UpgradeType.Attack:
            if (PlayerPrefs.GetInt("attackUpgrade") == 0)
            {
                PlayerPrefs.SetInt("attackUpgrade", 3);
                value = 3;
            }
            else
            {
                value = PlayerPrefs.GetInt("attackUpgrade");
            }
            break;

        case UpgradeType.Defense:
            if (PlayerPrefs.GetInt("defenseUpgrade") == 0)
            {
                PlayerPrefs.SetInt("defenseUpgrade", 5);
                value = 5;
            }
            else
            {
                value = PlayerPrefs.GetInt("defenseUpgrade");
            }
            break;

        default:
            break;
        }
        player = Singleton_Service.GetSingleton <Player>();
        scene  = Singleton_Service.GetSingleton <SceneController>();
        IPL    = Singleton_Service.GetSingleton <Input_Listeners>();

        rightHand = GameObject.Find("RightHand").transform;
        leftHand  = GameObject.Find("LeftHand").transform;

        upgradeAudio = GetComponent <UpgradeAudio>();

        expandRate = new Vector3((maxScale - minScale) / 10, (maxScale - minScale) / 10, (maxScale - minScale) / 10);

        StartCoroutine("MoveUp");
    }
コード例 #25
0
 // Use this for initialization
 void Start()
 {
     agent       = GetComponent <NavMeshAgent>();
     targetArray = Singleton_Service.GetSingleton <NeutralMovement>();
     bigEnemy    = Singleton_Service.GetSingleton <GiantEnemy>();
     gunLight    = Singleton_Service.GetSingleton <Gun>();
     targetPos   = targetArray.emptyGameObjectList[Random.Range(0, targetArray.emptyGameObjectList.Count)].transform.position;
     agent.SetDestination(targetPos);
     check = 0;
 }
コード例 #26
0
    public void StopChestAnimation()
    {
        anim.speed = 0;
        GameObject staff = transform.GetChild(3).gameObject;

        staff.transform.parent        = Singleton_Service.GetSingleton <RightHand>().transform;
        staff.transform.localPosition = Vector3.zero;
        staff.transform.localRotation = Quaternion.Euler(0, 90, 0);
        StartCoroutine("FadePlayer");
    }
コード例 #27
0
 // Use this for initialization
 void Start()
 {
     agent       = GetComponent <NavMeshAgent>();
     playerRig   = Singleton_Service.GetSingleton <Player>();
     bigEnemy    = Singleton_Service.GetSingleton <GiantEnemy>();
     targetArray = Singleton_Service.GetSingleton <NeutralMovement>();
     gunLight    = Singleton_Service.GetSingleton <Gun>();
     agent.SetDestination(playerRig.transform.position);
     enemyHP = 3;
 }
コード例 #28
0
 // Use this for initialization
 void Start()
 {
     if (transform.parent.gameObject.GetComponent <RightHand>() != null)
     {
         scene       = Singleton_Service.GetSingleton <SceneController>();
         IPL         = Singleton_Service.GetSingleton <Input_Listeners>();
         currentBall = Instantiate(energyBall, transform);
         currentBall.transform.localPosition = new Vector3(0f, 0.75f, 0f);
         currentBall.transform.localScale    = new Vector3(0.1f, 0.1f, 0.1f);
     }
 }
コード例 #29
0
    void Start()
    {
        isHit = false;
        if (this.transform.parent != null)
        {
            attachedEnemy = this.transform.parent.GetComponent <Enemy>();
        }

        currElementComponent = GetComponent <Fire>();
        playerSword          = Singleton_Service.GetSingleton <SwordUI>();
    }
コード例 #30
0
 private void Update()
 {
     if (charged && IPL.GetRightTriggerInteracted())
     {
         rightHand = Singleton_Service.GetSingleton <RightHand>();
         rightHand.StartCoroutine(rightHand.LongVibration(0.05f, 1f));
         currentBall.GetComponent <EnergyBall>().StartCoroutine("Shoot");
         currentBall = Instantiate(energyBall, transform);
         currentBall.transform.localPosition = new Vector3(0f, 0.75f, 0f);
         currentBall.transform.localScale    = new Vector3(0.1f, 0.1f, 0.1f);
         charged = false;
     }
 }