void replay()
    {
        GameObject box = boxes[actualVertex];

        vertexScript = (NodeGeneration)box.GetComponent(typeof(NodeGeneration));
        vertexScript.visit(id, true);
    }
示例#2
0
文件: GOD.cs 项目: mwebi/AxonClone
 // Use this for initialization
 void Start()
 {
     NodeGenerationScript = NodeGeneratorObject.GetComponent<NodeGeneration>();
     RangeCircleScript = RangeCircleObject.GetComponent<RangeCircle>();
     PlayerScript = PlayerObject.GetComponent<Player>();
     ScoreCounterScript = ScoreCounterObject.GetComponent<ScoreCounter>();
     RestartButtonScript = RestartButtonObject.GetComponent<RestartButton>();
     NeuronLineScript = NeuronLineObject.GetComponent<NeuronLine>();
 }
 public void restart()
 {
     for (int i = 0; i < 26; i++)
     {
         visited[i]   = false;
         vertexScript = (NodeGeneration)boxes[i].GetComponent(typeof(NodeGeneration));
         vertexScript.quitPlayer(id);
     }
     goToVertex(initialVertex, false);
 }
    public void goToVertex(int vertex, bool init = true)
    {
        GameObject box = boxes[vertex];

        transform.position = box.transform.position;
        transform.Translate(Vector3.back * 0.5f);
        vertexScript = (NodeGeneration)box.GetComponent(typeof(NodeGeneration));
        vertexScript.visit(id, init);
        visited[vertex] = true;
        actualVertex    = vertex;
    }