// take out the important information from the message
    public void route(string S)
    {
        if (S != null && S.Equals("") == false && S.Length > 0)
        {
            string name = S.Substring(0, S.IndexOf(','));
            S = cut(S);
// send the message on to the designated recipient inout

            if (name == "player4")
            {
                player4Script player4 = GetComponentInChildren <player4Script> ();

                // send the action name, return the reply that is generated
                string reply = player4.translate(S);
                // if there is a reply send one
                if (reply.Equals("") == false && reply != null && S.Length > 0)
                {
                    externalComm.SendMessage("player4," + reply + ";");
                }
            }
            if (name == "ball")
            {
                ballScript ball = GetComponentInChildren <ballScript> ();

                // send the action name, return the reply that is generated
                string reply = ball.translate(S);
                // if there is a reply send one
                if (reply.Equals("") == false && reply != null && S.Length > 0)
                {
                    externalComm.SendMessage("ball," + reply + ";");
                }
            }
        }
    }
예제 #2
0
    public void CmdSpawnItems()
    {
        int spawnNum = RandomInt2();

        ballList = FindObjectsOfType <ballScript>();
        bool canSpawn = true;

        for (int i = 0; i < ballList.Length; i++)
        {
            if (ballList[i].spawnPlace == spawnNum)
            {
                canSpawn = false;
                break;
            }
        }
        //place a check here for if ball is spawnwed or not
        if (canSpawn)
        {
            GameObject item1 = Instantiate(balls[RandomInt()], spawns[spawnNum].position, spawns[spawnNum].rotation);
            BS = item1.GetComponent <ballScript>();
            Debug.Log("spawning balls");
            BS.spawnPlace = spawnNum;
            NetworkServer.Spawn(item1);
        }
    }
예제 #3
0
 void Start()
 {
     this.damageText  = GameObject.Find("damageText");
     this.damegeText2 = GameObject.Find("damegeText2");
     Mikatatern       = GameObject.Find("controller").GetComponent <ballScript>();
     Tekiturn         = GameObject.Find("enemy").GetComponent <Enemy>();
 }
예제 #4
0
 /// <summary>
 /// スキルの使用回数を決める処理
 /// </summary>
 private void TrigggerSkill()
 {
     // スキルの使用回数確認
     if (SukillCount > 0)
     {
         ballScript = GameObject.Find("Main Camera").GetComponent <ballScript>();
         SukillCount--;
         buttonskill.interactable = false;
     }
 }
예제 #5
0
 void OnCollisionEnter2D(Collision2D coll)
 {
     if (coll.transform.tag == "ball")
     {
         canCatchBall = true;
         if (bS == null)
         {
             bS = coll.gameObject.GetComponent <ballScript> ();
         }
     }
 }
예제 #6
0
    void OnMouseUp()
    {
        dragging = false;

        mouseEnd = new Vector2(xForce * moveSpeed, yForce * moveSpeed);

        GameObject ball   = Instantiate(ballToThrow, transform.position, transform.rotation) as GameObject;
        ballScript script = ball.GetComponent <ballScript> ();



        script.mouseVector        = mouseEnd;
        script.numberOfTouchesMax = numberOfTouches;
        script.ready = true;


        xForce = 0f;
        yForce = 0f;

        crosshair.renderer.enabled = false;
    }
예제 #7
0
 public void setBall(ballScript ball)
 {
     BS = ball;
 }
예제 #8
0
 //importing data
 void Start()
 {
     ball = GameObject.FindWithTag("Ball").GetComponent <ballScript>();
 }
예제 #9
0
 //passing the parameters i'll use in future into start function so that they are already accessible
 void Start()
 {
     ui   = GameObject.FindWithTag("ui").GetComponent <UiManagerScript>();
     ball = GameObject.FindWithTag("Ball").GetComponent <ballScript>();
 }
예제 #10
0
파일: Daria.cs 프로젝트: tama129/puzzle
 // Start is called before the first frame update
 void Start()
 {
     damege = GameObject.Find("controller").GetComponent <ballScript>();
 }
예제 #11
0
 public void setBall(ballScript ball)
 {
     TopPlayer.setBall(ball);
 }