public override void OnAwake() { base.OnAwake(); if (netObj) { syncState = netObj.GetComponent <SyncState>(); } }
public override void OnAwakeInitialize(bool isNetObject) { if (isNetObject) { syncState = transform.GetNestedComponentInParent <SyncState, NetObject>(); syncStateMountMask = (syncState) ? syncState.mountableTo.mask : 0; } base.OnAwakeInitialize(isNetObject); }
public override void OnAwake() { base.OnAwake(); if (netObj) { syncState = netObj.GetComponent <SyncState>(); } if (!GetComponent <SyncState>()) { Debug.LogWarning(GetType().Name + " on '" + transform.parent.name + "/" + name + "' needs to be on the root of NetObject with component " + typeof(SyncState).Name + ". Disabling."); netObj.RemoveInterfaces(this); } }
public override void OnAwake() { base.OnAwake(); if (netObj) { syncState = netObj.GetComponent <SyncState>(); } //if (respawnEnable) // syncState.respawnState = ObjState.Despawned; spawnWaitAsTicks = ConvertSecsToTicks(initialDelay); respawnWaitAsTicks = ConvertSecsToTicks(respawnDelay); despawnWaitAsTicks = ConvertSecsToTicks(despawnDelay); bitsForTicksUntilRespawn = System.Math.Max(respawnWaitAsTicks, spawnWaitAsTicks).GetBitsForMaxValue(); bitsForTicksUntilDespawn = despawnWaitAsTicks.GetBitsForMaxValue(); }
public override void OnEnable() { base.OnEnable(); syncState = (target as ContactReactorBase).transform.GetNestedComponentInParent <SyncState, NetObject>(); }
protected override void Start() { base.Start(); syncState = transform.GetComponentInParent <SyncState>(); }