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

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

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