Esempio n. 1
0
 /// <summary>
 /// Initialization
 /// </summary>
 public virtual void Initialize()
 {
     if (bInitialized)
     {
         return;
     }
     mForce = GetComponent <PhysicalForce>();
     if (!mForce)
     {
         Debug.LogError("PhysicalForce Missing");
         mForce = gameObject.AddComponent <PhysicalForce>();
     }
 }
Esempio n. 2
0
    // Use this for initialization
    void Start()
    {
        forceHandle = GetComponent <PhysicalForce>();
        if (!rigidbodyRoot)
        {
            Debug.LogError("Need assign root of rigidbodys, use self by default", this);
            rigidbodyRoot = transform;
        }
        else
        {
            childRigidbodys = rigidbodyRoot.GetComponentsInChildren <Rigidbody>();
        }

        //SetActiveState();

        initForce = windForce;
    }