コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     if (instance == null)
     {
         instance = this;
         StartCoroutine(RestoreEnergyBallanceCoroutine());
     }
     else
     {
         Debug.LogError("Only one Energy Conservation Watch Dog allowed!");
     }
 }
コード例 #2
0
    // Start is called before the first frame update
    void Start()
    {
        // Caching components
        ecwd = EnergyConservationWatchDog.instance;
        rb2d = GetComponent <Rigidbody2D>();
        ecwd.atoms.Add(rb2d);
        //atoms.Add(rb2d);

        // Launching coroutine if it isn't running yet
        if (!coroutineActive)
        {
            coroutineActive = true;
            StartCoroutine(CalculateTKEDaemon(1.0f));
        }
    }
コード例 #3
0
 // Start is called before the first frame update
 void Start()
 {
     ecwd = EnergyConservationWatchDog.instance;
 }