Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        distance = findDistance();


        gameData         = GetComponent <gameStateDataClass>();
        startTotalTarget = countTotalTarget();
    }
 // Use this for initialization
 void Start()
 {
     gameStateDataClass = GetComponent <gameStateDataClass>();
     if (gameStateDataClass.gameWin == gameStateDataClass.gameWinCondition.reciprocal)
     {
         StartCoroutine(reciprocal());
     }
 }
 // Use this for initialization
 void Start()
 {
     gameManager        = GameObject.FindGameObjectsWithTag("backgroundScipt")[0].GetComponent <gameManager>();
     gameStateDataClass = GetComponent <gameStateDataClass>();
     if (gameStateDataClass.gameWin == gameStateDataClass.gameWinCondition.reciprocal)
     {
         StartCoroutine(reciprocal());
     }
 }
 void Awake()
 {
     //DontDestroyOnLoad(transform.gameObject);
     if (staticGameStateDataClass != null)
     {
         Destroy(this);
     }
     else
     {
         staticGameStateDataClass = this;
     }
 }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     playerDataClass              = GetComponent <playerDataClass>();
     gameStateDataClass           = GetComponent <gameStateDataClass>();
     gameStateDataClass.gamestate = gameStateDataClass.gameState.game;
     //scriptText = GetComponent<Text>();
     if (pauseMenuCanvas != null)
     {
         pauseMenuCanvas.SetActive(false);
     }
     if (volSlider != null)
     {
         volSlider.value = 1;
     }
 }
    public void npcHPCheck(short DamageDeal, string dealerStringType)
    {
        #region HP


        if (dealerStringType == "player")   //是誰打出這個傷害
        {
            npcclass.HP = 0;
        }
        else
        {
        }

        npcclass.HP -= DamageDeal;
        if (npcclass.HP <= 0)
        {
            npcclass.liveStateP = npcClass.liveState.dead;
            whoKillThis         = dealerStringType;
            if (dealerStringType == "player")   //是誰打出這個傷害
            //playerData.HP = playerData.MAXHP;
            {
            }

            //Destroy(gameObject);

            if (npcclass.TypeP == npcClass.Type.contorl)
            {
                TestAnimator.SetBool("hit_sword", true);
                if (playerData.HP - DamageDeal <= 0) //玩家控制並玩家已經沒有hp
                {
                    Time.timeScale = 1f;
                    playerData.HP  = 0.0f;
                    npcclass.TypeP = npcClass.Type.normal;
                    OnPlayerGameOver(); //player gameover  這堆code應該放在player
                    gameStateDataClass gameState = GameObject.FindGameObjectsWithTag("backgroundScipt")[0].GetComponent <gameStateDataClass>();
                    gameState.gamestate = gameStateDataClass.gameState.gameover;
                }
                else  //玩家控制並玩家還有hp
                {
                    playerData.HP -= DamageDeal;
                }
            }
        }
        #endregion
    }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        //volSlider = GameObject.FindGameObjectWithTag("soundBar").GetComponent<Slider>();

        playerDataClass = GetComponent <playerDataClass>();
        if (GetComponent <gameStateDataClass>() != null)
        {
            gameStateDataClass           = GetComponent <gameStateDataClass>();
            gameStateDataClass.gamestate = gameStateDataClass.gameState.game;
        }

        //scriptText = GetComponent<Text>();
        if (pauseMenuCanvas != null)
        {
            pauseMenuCanvas.SetActive(false);
        }
        if (volSlider != null)
        {
            volSlider.value = 1;
        }
    }