/// <summary> /// Initialization /// </summary> public virtual void Initialize() { if (bInitialized) { return; } mForce = GetComponent <PhysicalForce>(); if (!mForce) { Debug.LogError("PhysicalForce Missing"); mForce = gameObject.AddComponent <PhysicalForce>(); } }
// 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; }