コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        // Update planet position
        transform.position = OOPDataManager.RotateAroundPoint(transform.position, Vector3.zero, Vector3.up, movementSpeed * Time.deltaTime);;

        // Update planet position reference
        OOPDataManager.UpdatePlanetPosition(ID, transform.position);
    }
コード例 #2
0
 private void Awake()
 {
     // Singleton Pattern
     // If instance is already instantiated and instance isn't equal to this instance destroy
     if (instance != null && instance != this)
     {
         Destroy(this);
     }
     // Otherwise set instance as self
     else
     {
         instance = this;
     }
 }