コード例 #1
0
ファイル: Crys.cs プロジェクト: CoolYiWen/JCCultureGame
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.name == Constant.Name_Player)
     {
         this.gameObject.SetActive(false);
         BlackBoardHelper.ChangeCrysNumber(m_CrysNumber);
     }
 }
コード例 #2
0
ファイル: Tablet.cs プロジェクト: CoolYiWen/JCCultureGame
    void OnTriggerStay2D(Collider2D other)
    {
        if (other.name == Constant.Name_Player)
        {
            if (ETCInput.GetButton(Constant.Button_Click))
            {
                if (BlackBoardHelper.GetCrysNumber() >= CryCostNumber)
                {
                    BlackBoardHelper.ChangeCrysNumber(-CryCostNumber);
                    BuildingFlog.SetActive(false);
                    GameManager.Instance.BuildingStates [GameManager.Instance.currentScene * 4 - 4 + BuildingId - 1] = true;
                    GameManager.Instance.BuildingId = BuildingId;

                    DataManager.Instance.SetBuildingStates(GameManager.Instance.BuildingStates);

                    UIManager.Instance.ShowBuildingPanel();
                }
            }
        }
    }