コード例 #1
0
 public void AddtoList(GameObject picked, float timed)
 {
     PickUpSpawn ps = new PickUpSpawn();
     ps.TargetPickup = picked;
     ps.PickupTime = timed;
     toSpawnList.Add(ps);
 }
コード例 #2
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);
    }
コード例 #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> ();
 }