public static void DestroyProp(DestructableProp prop) { int id = prop.Id; instance.DestroyPropRPC(id); instance.networkView.RPC("DestroyPropRPC", RPCMode.Others, id); }
public static void DestroyProp(DestructableProp prop) { int id = prop.Id; instance.DestroyPropRPC (id); instance.networkView.RPC ("DestroyPropRPC", RPCMode.Others, id); }
void DestroyPropRPC(int id) { DestructableProp prop = props [id]; prop.Death(); props.Remove(id); }
void CreatePropRPC(int id, int prefabId, Vector3 pos, Quaternion rot) { GameObject prefab = PropPrefabs [prefabId]; GameObject prop = (GameObject)Instantiate(prefab, pos, rot); DestructableProp des = prop.GetComponent <DestructableProp> (); des.Id = id; props.Add(id, des); }
public int DestroyProp(DestructableProp prop) { _props.Remove(prop); Broadcast($"They're smashing up {name} , get to the {area} "); if (_props.Count < 1) { OnRoomDestroyed?.Invoke(this); Broadcast($"Room {name} in {area} is completely trashed"); } return(_props.Count); }
public override void Init() { target = Owner.Fsm.GetDestructionTarget(); Owner.TargetProp = target; Nav.isStopped = false; if (target == null) { Owner.Fsm.ChangeState(Owner.Fsm.LeaveRoom); return; } Nav.SetDestination(target.transform.position); }
public override void Init() { Nav.isStopped = true; _target = Owner.TargetProp; }