public void DestroyTag(string[] args) { GameObject[] objsTag = (GameObject.FindGameObjectsWithTag(CommandLineCore.StringWithSpaces(args, 2))); foreach (var item in objsTag) { Destroy(item); } }
private void ChangeTransform(string[] args) { switch (args[1]) { case "position": case "setposition": GameObject.Find(CommandLineCore.StringWithSpaces(args, 5)).transform.position = new Vector3(float.Parse(args[2]), float.Parse(args[3]), float.Parse(args[4])); break; case "move": GameObject.Find(CommandLineCore.StringWithSpaces(args, 5)).transform.position += new Vector3(float.Parse(args[2]), float.Parse(args[3]), float.Parse(args[4])); break; case "rotation": case "setrotation": GameObject.Find(CommandLineCore.StringWithSpaces(args, 5)).transform.eulerAngles = new Vector3(float.Parse(args[2]), float.Parse(args[3]), float.Parse(args[4])); break; case "rotate": GameObject.Find(CommandLineCore.StringWithSpaces(args, 5)).transform.Rotate(float.Parse(args[2]), float.Parse(args[3]), float.Parse(args[4])); break; case "scale": case "setscale": GameObject.Find(CommandLineCore.StringWithSpaces(args, 5)).transform.localScale = new Vector3(float.Parse(args[2]), float.Parse(args[3]), float.Parse(args[4])); break; case "addscale": GameObject.Find(CommandLineCore.StringWithSpaces(args, 5)).transform.localScale += new Vector3(float.Parse(args[2]), float.Parse(args[3]), float.Parse(args[4])); break; case "getposition": CommandLineCore.Print(GameObject.Find(CommandLineCore.StringWithSpaces(args, 2)).transform.position.ToString()); break; case "getrotation": CommandLineCore.Print(GameObject.Find(CommandLineCore.StringWithSpaces(args, 2)).transform.rotation.ToString()); break; case "getscale": CommandLineCore.Print(GameObject.Find(CommandLineCore.StringWithSpaces(args, 2)).transform.localScale.ToString()); break; } }
public void InstantiateObj(string[] args) { Instantiate(Resources.Load(CommandLineCore.StringWithSpaces(args, 2))); }
public void DestroyObj(string[] args) { Destroy(GameObject.Find(CommandLineCore.StringWithSpaces(args, 2))); }
public void CallTag(string[] args) { GameObject objTag = GameObject.FindGameObjectWithTag(CommandLineCore.StringWithSpaces(args, 3)); objTag.SendMessage(args[2]); }
public void Call(string[] args) { GameObject obj = GameObject.Find(CommandLineCore.StringWithSpaces(args, 3)); obj.SendMessage(args[2]); }