Esempio n. 1
0
        public T ReadValue <T>(EntityIdentifier entityId, string command)
        {
            // TODO: optimize
            object result;

            commandDict.TryGetValue(command, out result);
            return((result == null) ? default(T) : (T)result);  // TODO
        }
Esempio n. 2
0
        public T Spawn <T>(T prefab, Vector3 position, Quaternion rotation) where T : EntityComponent
        {
            var obj = Instantiate(prefab, position, rotation);

            obj.identifier = EntityIdentifier.GetNew();
            this.Timeline.Replace(obj.identifier, new Spawn {
                obj = obj.gameObject
            });
            return(obj);
        }
Esempio n. 3
0
 public TimelineEvent(EntityIdentifier id, ValueType item)
 {
     this.id   = id;
     this.item = item;
 }
Esempio n. 4
0
 void HandleSpawn(EntityIdentifier id, Spawn s)
 {
     Destroy(s.obj);
     this.Timeline.ForgetTheFuture(id);
 }
Esempio n. 5
0
 void HandleDespawn(EntityIdentifier id, Despawn ds)
 {
     ds.obj.SetActive(true);
 }
Esempio n. 6
0
 public bool Equals(EntityIdentifier other)
 {
     //return this.tag == other.tag && this.identifier == other.identifier;
     return(this.identifier == other.identifier);
 }
Esempio n. 7
0
 public void SetValue <T>(EntityIdentifier id, string command, T value)
 {
     commandDict[command] = value;
 }