Exemplo n.º 1
0
 public void DestroyTag(string[] args)
 {
     GameObject[] objsTag = (GameObject.FindGameObjectsWithTag(CommandLineCore.StringWithSpaces(args, 2)));
     foreach (var item in objsTag)
     {
         Destroy(item);
     }
 }
Exemplo n.º 2
0
    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;
        }
    }
Exemplo n.º 3
0
 public void InstantiateObj(string[] args)
 {
     Instantiate(Resources.Load(CommandLineCore.StringWithSpaces(args, 2)));
 }
Exemplo n.º 4
0
 public void DestroyObj(string[] args)
 {
     Destroy(GameObject.Find(CommandLineCore.StringWithSpaces(args, 2)));
 }
Exemplo n.º 5
0
    public void CallTag(string[] args)
    {
        GameObject objTag = GameObject.FindGameObjectWithTag(CommandLineCore.StringWithSpaces(args, 3));

        objTag.SendMessage(args[2]);
    }
Exemplo n.º 6
0
    public void Call(string[] args)
    {
        GameObject obj = GameObject.Find(CommandLineCore.StringWithSpaces(args, 3));

        obj.SendMessage(args[2]);
    }