公共类游戏管理器: MonoBehaviour { 公共静态Gamemanager实例;SerializeField私有空唤醒(){ if(instance == null) // if instanceis not initilized then instance is equal to class
instance =this; } }//classs
我的基本想法是,当我得分的时候,我得到了2分,但是当我碰到一个对撞机时,这个对撞机变成了3分,我很难弄清楚要使用什么对撞机,以及如何使用它们。当我触摸立方体时,它应该变成3。if (i touch a certain collider) void OnTriggerEnter(Collider other) ScoringSystem.theScore += 3;}{}