void OnEnable() { if (m_RB == null) { m_RB = GetComponent <Rigidbody>(); } m_TimedDestroy = null; m_RB.velocity = Vector3.zero; m_RB.useGravity = false; }
public void StartDestroyTimer() { if (m_TimedDestroy != null) { return; } if (monobitView.isMine) { monobitView.RPC("StartDestroyTimer", MonobitEngine.MonobitTargets.Others); } m_TimedDestroy = gameObject.AddComponent <NetworkTimedDestroy>(); m_TimedDestroy.m_IsPoolObject = true; m_TimedDestroy.m_DestroyTime = Random.Range(m_MinDestroyTime, m_MaxDestroyTime); }