コード例 #1
0
    // Start is called before the first frame update
    void Start()
    {
        setPaused(false);
        onBeatEvent            = new UnityEvent();
        redButtonCanPressEvent = new UnityEvent();
        playerList             = new List <PlayerControl>();
        if (_instance == null)
        {
            _instance = this;
        }

        //reference initializations
        //pause_bg = GameObject.Find("Pause_BG").GetComponent<Image>();
        if (pause_menu && !game_paused)
        {
            pause_menu.SetActive(false);
        }
        red_button = GameObject.Find("Buttons_Red");
        if (red_button != null)
        {
            buttonControllerScript = red_button.GetComponent <buttonController>();
        }
        GameObject boss1 = GameObject.Find("Boss1");
        GameObject boss2 = GameObject.Find("Boss2");

        if (red_button != null)
        {
            Text gui_combo = GameObject.Find("Combo").GetComponent <Text>();
            Text gui_mult  = GameObject.Find("Multiplier").GetComponent <Text>();
        }
        if (buttonControllerScript)
        {
            buttonControllerScript.endBeatEvent.AddListener(resetFireRates);
        }
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        RB = gameObject.transform.GetChild(1).gameObject;
        LB = gameObject.transform.GetChild(2).gameObject;
        LT = gameObject.transform.GetChild(3).gameObject;
        RT = gameObject.transform.GetChild(4).gameObject;

        body = gameObject.transform.GetComponent <Rigidbody>();
        body.maxAngularVelocity = MaxAngularVelocity;

        joints  = GetComponents(typeof(ConfigurableJoint));
        RBjoint = (ConfigurableJoint)joints[0];
        LBjoint = (ConfigurableJoint)joints[1];
        LTjoint = (ConfigurableJoint)joints[2];
        RTjoint = (ConfigurableJoint)joints[3];

        RBobj = RB.GetComponent <playerChildren>();
        LBobj = LB.GetComponent <playerChildren>();
        RTobj = RT.GetComponent <playerChildren>();
        LTobj = LT.GetComponent <playerChildren>();

        RBgrabbing = false;
        LBgrabbing = false;
        RTgrabbing = false;
        LTgrabbing = false;

        buttons          = buttonsTrans.GetComponent <buttonController>();
        gameInputManager = GameInputManager.instance;
    }
コード例 #3
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
     promptHolder.SetActive(false);
     postPromptHolder.SetActive(false);
     identityHolder.SetActive(false);
     matchHolder.SetActive(false);
 }
コード例 #4
0
 void Start()
 {
     // NoteScore = 3: Good
     // NoteScore = 2: Great
     // NoteScore = 1: Perfect
     buttonController = button.GetComponent <buttonController>();
     GreatTrigger     = buttonController.Great.GetComponent <Collider2D>();
     PerfectTrigger   = buttonController.Perfect.GetComponent <Collider2D>();
     keyButton        = buttonController.KeyToPress;
 }
コード例 #5
0
 /**
  * @pre Colliders have left contact
  * @post Remove pair and revert bonding to unbonded state
  * @param Collider2D collision
  * @return None
  */
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.tag == "Open")
     {
         if (collision.GetComponent <buttonController>().buttonTeam == partTeam)
         {
             partReadyToPair = false;
             bondTarget      = null;
         }
     }
 }
コード例 #6
0
 /**
  * @pre Colliders made contact
  * @post Attempt to pair/bond colliders of ship part and board square
  * @param Collider2D collision
  * @return None
  */
 private void OnTriggerEnter2D(Collider2D collision)   //colliders of buttons and of ship are connected. Collider is the button collider, so checks if their is already a ship places w/ help from OnTriggerStay2D in buttonController.
 {
     if (collision.tag == "Open")
     {
         if (collision.GetComponent <buttonController>().buttonTeam == partTeam)
         {
             partReadyToPair = true;
             bondTarget      = collision.GetComponent <buttonController>();
         }
     }
 }
コード例 #7
0
    // Start is called before the first frame update
    void Start()
    {
        if (GameObject.Find("Buttons_Red"))
        {
            red_button             = GameObject.Find("Buttons_Red");
            buttonControllerScript = red_button.GetComponent <buttonController>();
            direction   = red_button.GetComponent <Transform>().position - transform.position;
            distance    = direction.magnitude;
            travel_time = 60 / (float)noteShooter.bpm;//seconds

            //print(travel_time);
        }
    }
コード例 #8
0
    void Start()
    {
        Button btn = ViewButton.GetComponent <Button>();

        btn.onClick.AddListener(viewData);
        Button btn1 = pathButton.GetComponent <Button>();

        btn1.onClick.AddListener(clearVisibleObjects);

        GameObject       canvas = GameObject.Find("Canvas");
        buttonController bc     = canvas.GetComponent <buttonController>();

        UnityEngine.Debug.Log(bc);
        pointsInRoomView = bc.pointsInRoom;
    }
コード例 #9
0
    public void clearVisibleObjects()
    {
        if (visibleObjects != null)
        {
            for (int i = 0; i < visibleObjects.Count; i++)
            {
                GameObject ob = GameObject.Find(visibleObjects[i]);
                Destroy(ob);
            }
            visibleObjects.Clear();
        }
        GameObject       canvas = GameObject.Find("Canvas");
        buttonController bc     = canvas.GetComponent <buttonController>();

        bc.hidePaths();
    }
コード例 #10
0
    public void createBlob(string point, string cube, string room)
    {
        GameObject c        = new GameObject();
        float      multiple = 0.0f;

        if (cube == "Cube3")   //VAV
        {
            c        = Cube3;
            multiple = -0.75f;
        }
        else if (cube == "Cube2")   //Actuator
        {
            c        = Cube2;
            multiple = -0.5f;
        }
        else if (cube == "Cube")    //Sensor
        {
            c        = Cube;
            multiple = -1.0f;
        }
        string     obj          = room.Replace("Room-", "");
        Collider   newObj       = GameObject.Find(obj).GetComponent <Collider>();
        Vector3    centreOfRoom = newObj.bounds.center;
        GameObject blob         = Instantiate(c);

        blob.name = "sensor_" + point;

        blob.SetActive(true);

        GameObject       canvas = GameObject.Find("Canvas");
        buttonController bc     = canvas.GetComponent <buttonController>();

        List <Vector3> pointss = (List <Vector3>)bc.pointsInRoom[room];

        UnityEngine.Debug.Log(room);
        UnityEngine.Debug.Log(pointss);
        blob.transform.position = pointss[0];

        List <Vector3> updatedPoints = (List <Vector3>)bc.usedPointsInRoom[room];

        updatedPoints.Add(pointss[0]);
        bc.usedPointsInRoom[room] = updatedPoints;

        pointss.Remove(pointss[0]);
        bc.pointsInRoom[room] = pointss;
    }
コード例 #11
0
    // Start is called before the first frame update
    void Start()
    {
        playerHealth = maxHealth;

        red_button = GameObject.Find("Buttons_Red");
        if (red_button != null)
        {
            ButtonController = red_button.GetComponent <buttonController>();
        }
        playerTouchingEnemy = new UnityEvent();
        GameManager.Instance.RegisterPlayerControl(this);
        rb2d = GetComponent <Rigidbody2D>();
        //facingRight = true;
        speed = ((float)noteShooter.bpm / 100);
        //print(noteShooter.bpm);
        isDrummerStationary        = false;
        drummerAnimationController = GetComponent <Animator>();

        //print(Input.GetJoystickNames().Length);
        //tutorialText = GameObject.Find("Tutorial Text").GetComponent<tutorialTexts>();
    }
コード例 #12
0
	//public Text debug;
	void Awake(){
	    if (instance == null){
			instance = this;
		}
		buttonLeft = GameObject.Find("left");
		buttonRight = GameObject.Find("right");
		buttonBackward = GameObject.Find("backward");
		buttonForward = GameObject.Find("forward");
        buttonDone = GameObject.Find("done");
        
		wallFront = GameObject.Find("wallFront");
		wallBack = GameObject.Find("wallBack");
		wallLeft = GameObject.Find("wallLeft");
		wallRight = GameObject.Find("wallRight");
		
        realButtonLeft = GameObject.Find("polySurface2");
		realButtonRight = GameObject.Find("polySurface3");
		realButtonBackward = GameObject.Find("polySurface1");
		realButtonForward = GameObject.Find("polySurface5");
        realButtonDone = GameObject.Find("polySurface6");

		claw_base_position = GameObject.Find("claw_base_boundary");
		
	}