public override void OnAwake()
        {
            base.OnAwake();

            if (netObj)
            {
                syncState = netObj.GetComponent <SyncState>();
            }
        }
Example #2
0
        public override void OnAwakeInitialize(bool isNetObject)
        {
            if (isNetObject)
            {
                syncState          = transform.GetNestedComponentInParent <SyncState, NetObject>();
                syncStateMountMask = (syncState) ? syncState.mountableTo.mask : 0;
            }

            base.OnAwakeInitialize(isNetObject);
        }
Example #3
0
        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();
        }
Example #5
0
 public override void OnEnable()
 {
     base.OnEnable();
     syncState = (target as ContactReactorBase).transform.GetNestedComponentInParent <SyncState, NetObject>();
 }
Example #6
0
 protected override void Start()
 {
     base.Start();
     syncState = transform.GetComponentInParent <SyncState>();
 }