Exemple #1
0
    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);

	}
Exemple #3
0
    void DestroyPropRPC(int id)
    {
        DestructableProp prop = props [id];

        prop.Death();

        props.Remove(id);
    }
Exemple #4
0
    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);
    }
Exemple #5
0
        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);
        }
Exemple #7
0
 public override void Init()
 {
     Nav.isStopped = true;
     _target       = Owner.TargetProp;
 }