Exemplo n.º 1
0
 void Start()
 {
     swordUI = Singleton_Service.GetSingleton <SwordUI>();
     IPL     = Singleton_Service.GetSingleton <Input_Listeners>();
     rb      = GetComponent <Rigidbody>();
     //StartCoroutine("CheckShurikenParent");
 }
Exemplo n.º 2
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>();
 }
    // 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();
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     SED        = Singleton_Service.GetSingleton <ScannerEffectDemo>();
     bulletTime = Singleton_Service.GetSingleton <Gun>();
     StartCoroutine("BulletDeath");
     StartCoroutine("bulletLifespan");
 }
    // 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;*/
    }
Exemplo n.º 6
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);
    }
 public void BossDie()
 {
     finalBubbleEffect.SetActive(false);
     finalShieldEffect.SetActive(false);
     Singleton_Service.GetSingleton <GameMusic>().PlayCreditsMusic();
     gameObject.SetActive(false);
 }
 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>();
 }
Exemplo n.º 9
0
 // Use this for initialization
 void Start()
 {
     IPL = Singleton_Service.GetSingleton <Input_Listeners>();
     WarningText.SetActive(false);
     switchTime = false;
     StartCoroutine("SwitchToFire");
 }
Exemplo n.º 10
0
    IEnumerator GetReady()
    {
        yield return(new WaitForSeconds(2f));

        rightHand = Singleton_Service.GetSingleton <RightHand>();
        isReady   = true;
    }
Exemplo n.º 11
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);
    }
 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>();
 }
Exemplo n.º 13
0
 void OnTriggerStay(Collider other)
 {
     if (IPL == null)
     {
         IPL = Singleton_Service.GetSingleton <Input_Listeners>();
     }
 }
Exemplo n.º 14
0
    public void Start()
    {
        IPL         = Singleton_Service.GetSingleton <Input_Listeners>();
        playerSword = Singleton_Service.GetSingleton <SwordUI>();
        type        = "Fire";

        thisCollider = GetComponent <BoxCollider>();
    }
 // Use this for initialization
 void Start()
 {
     maxScale = 0.15f;
     minScale = 0.11f;
     scene    = Singleton_Service.GetSingleton <SceneController>();
     player   = Singleton_Service.GetSingleton <Player>();
     StartCoroutine("Charge");
 }
Exemplo n.º 16
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();
 }
Exemplo n.º 17
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>();
 }
 // Use this for initialization
 void Start()
 {
     if (PlayerPrefs.GetInt("hasPlayed") == 0)
     {
         gameObject.GetComponent <Button>().interactable = false;
     }
     door = Singleton_Service.GetSingleton <FrontDoor>();
 }
Exemplo n.º 19
0
 // Use this for initialization
 void Start()
 {
     scene        = Singleton_Service.GetSingleton <SceneController>();
     currentLevel = scene.GetCurrentLevel();
     numGems      = PlayerPrefs.GetInt("numGems");
     numDeaths    = PlayerPrefs.GetInt("NumDeaths");
     UpdatePlayerUI();
 }
Exemplo n.º 20
0
 void Start()
 {
     enemyBirds     = new List <BirdStatePattern>();
     OnSummon       = new UnityEvent();
     swordUI        = Singleton_Service.GetSingleton <SwordUI>();
     playerPosition = GameObject.FindGameObjectWithTag("Player Position").transform;
     UpdateBossUI();
     StartCoroutine("BossBehavior");
 }
Exemplo n.º 21
0
 private void Start()
 {
     swordUI    = Singleton_Service.GetSingleton <SwordUI>();
     enemyBirds = new List <BirdStatePattern>();
     if (spawnPoints != null && birdPrefab != null)
     {
         StartCoroutine("SpawnFlyingEnemies");
     }
 }
Exemplo n.º 22
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);
 }
Exemplo n.º 23
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>();
 }
Exemplo n.º 24
0
 void OnEnable()
 {
     Singleton_Service.RegisterSingletonInstance <Left_VR_Cont>(this);
     if (sheath != null)
     {
         sheath.leftController = this;
     }
     trackedObj = GetComponent <SteamVR_TrackedObject>();
 }
    // 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");
    }
Exemplo n.º 26
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;
 }
Exemplo n.º 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;
 }
    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");
    }
Exemplo n.º 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>();
    }
Exemplo n.º 30
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);
     }
 }