コード例 #1
0
    // Use this for initialization
    void Start()
    {
        charPhys   = GameObject.Find("MannFall").GetComponent <RungeKutta3>();
        buttonText = GameObject.Find("Text").GetComponent <Text>();
        heightText = GameObject.Find("HeightText").GetComponent <Text>();
        speedText  = GameObject.Find("SpeedText").GetComponent <Text>();
        timeText   = GameObject.Find("TimeText").GetComponent <Text>();
        pointsText = GameObject.Find("PointsText").GetComponent <Text>();

        Control = GameObject.Find("ControlObject").GetComponent <GlobalGameControl>();
    }
コード例 #2
0
    public void InitializationPlayer(GameObject selectedCharacter)
    {
        GameObject        oldPlayer         = GameObject.FindGameObjectWithTag("Player");
        Transform         startPoint        = GameObject.FindGameObjectWithTag("StartPoint").transform;
        Interface         Interface         = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Interface>();
        GlobalGameControl globalGameControl = GetComponent <GlobalGameControl>();

        if (oldPlayer != null)
        {
            Destroy(oldPlayer);
        }
        GameObject newPlayer = Instantiate(selectedCharacter, startPoint.position, Quaternion.identity);

        Interface.Player       = newPlayer;
        Interface.PlayerScript = newPlayer.GetComponent <Player>();
        Interface.Start();
        globalGameControl.Players[0] = newPlayer; // Запись в массив игрока
    }
コード例 #3
0
 private void Start()
 {
     opponent          = GetComponent <Opponent>();
     globalGameControl = GetComponent <GlobalGameControl>();
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     mycollider = GetComponent <CircleCollider2D>();
     phys       = GetComponent <PhysicsVariables>();
     Control    = GameObject.Find("ControlObject").GetComponent <GlobalGameControl>();
 }
コード例 #5
0
 private void Start()
 {
     globalGameControl = GetComponent <GlobalGameControl>();
 }