// 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 + ";"); } } } }
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); } }
void Start() { this.damageText = GameObject.Find("damageText"); this.damegeText2 = GameObject.Find("damegeText2"); Mikatatern = GameObject.Find("controller").GetComponent <ballScript>(); Tekiturn = GameObject.Find("enemy").GetComponent <Enemy>(); }
/// <summary> /// スキルの使用回数を決める処理 /// </summary> private void TrigggerSkill() { // スキルの使用回数確認 if (SukillCount > 0) { ballScript = GameObject.Find("Main Camera").GetComponent <ballScript>(); SukillCount--; buttonskill.interactable = false; } }
void OnCollisionEnter2D(Collision2D coll) { if (coll.transform.tag == "ball") { canCatchBall = true; if (bS == null) { bS = coll.gameObject.GetComponent <ballScript> (); } } }
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; }
public void setBall(ballScript ball) { BS = ball; }
//importing data void Start() { ball = GameObject.FindWithTag("Ball").GetComponent <ballScript>(); }
//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>(); }
// Start is called before the first frame update void Start() { damege = GameObject.Find("controller").GetComponent <ballScript>(); }
public void setBall(ballScript ball) { TopPlayer.setBall(ball); }