public void AddtoList(GameObject picked, float timed)
 {
     PickUpSpawn ps = new PickUpSpawn();
     ps.TargetPickup = picked;
     ps.PickupTime = timed;
     toSpawnList.Add(ps);
 }
    public void AddtoList(GameObject picked, GameObject target)
    {
        for (int i = 0; i < PickupTF.childCount; i++)
        {
            if (PickupTF.GetChild(i).gameObject == picked)
            {
                GetComponent<NetworkView>().RPC("HidePickUp", RPCMode.Others, i);
                if (picked.GetComponent<PickUpElement>().PT == PickUpType.Energy)
                {
                    target.GetComponent<PlayerControl>().MaxEnergy();
                    GameObject.FindGameObjectWithTag("NetworkController").GetComponent<NetworkController>().mNetworkview.RPC("MaxEnergy", target.GetComponent<PlayerControl>().mNetworkPlayer);
                }
                else
                {
                    target.GetComponent<PlayerControl>().MaxHealth();
                    GameObject.FindGameObjectWithTag("NetworkController").GetComponent<NetworkController>().mNetworkview.RPC("MaxHealth", target.GetComponent<PlayerControl>().mNetworkPlayer);
                }
            }
        }

        PickUpSpawn ps = new PickUpSpawn();
        ps.TargetPickup = picked;
        ps.PickupTime = Time.time;
        toSpawnList.Add(ps);
    }
示例#3
0
    public void AddtoList(GameObject picked, GameObject target)
    {
        for (int i = 0; i < PickupTF.childCount; i++)
        {
            if (PickupTF.GetChild(i).gameObject == picked)
            {
                GetComponent <NetworkView>().RPC("HidePickUp", RPCMode.Others, i);
                if (picked.GetComponent <PickUpElement>().PT == PickUpType.Energy)
                {
                    target.GetComponent <PlayerControl>().MaxEnergy();
                    GameObject.FindGameObjectWithTag("NetworkController").GetComponent <NetworkController>().mNetworkview.RPC("MaxEnergy", target.GetComponent <PlayerControl>().mNetworkPlayer);
                }
                else
                {
                    target.GetComponent <PlayerControl>().MaxHealth();
                    GameObject.FindGameObjectWithTag("NetworkController").GetComponent <NetworkController>().mNetworkview.RPC("MaxHealth", target.GetComponent <PlayerControl>().mNetworkPlayer);
                }
            }
        }

        PickUpSpawn ps = new PickUpSpawn();

        ps.TargetPickup = picked;
        ps.PickupTime   = Time.time;
        toSpawnList.Add(ps);
    }
示例#4
0
    public void AddtoList(GameObject picked, float timed)
    {
        PickUpSpawn ps = new PickUpSpawn();

        ps.TargetPickup = picked;
        ps.PickupTime   = timed;
        toSpawnList.Add(ps);
    }
示例#5
0
 void Awake()
 {
     pickUpSpawn = enemy.GetComponent <PickUpSpawn> ();
 }