예제 #1
0
    private void spawnTP()
    {
        // player1 stop moving
        GameObject p1 = GameObject.FindGameObjectsWithTag(tagPlayer1)[0];

        fc1 = p1.GetComponent <FiducialController>();
        fc1.doNotMove();

        // player2 stop moving
        GameObject p2 = GameObject.FindGameObjectsWithTag(tagPlayer2)[0];

        fc2 = p2.GetComponent <FiducialController>();
        fc2.doNotMove();

        Vector3    position1 = new Vector3(player1.position.x, player1.position.y, player1.position.z);
        Vector3    position2 = new Vector3(player2.position.x, player2.position.y, player2.position.z);
        GameObject tp1       = new GameObject();

        tp1 = Instantiate(Tp_Prefab, position1, player1.rotation);
        tp_list.Add(tp1);
        GameObject tp2 = new GameObject();

        tp2 = Instantiate(Tp_Prefab, position2, player2.rotation);
        tp_list.Add(tp2);
        SoundManager.Instance.PlayTransformClip();
    }
예제 #2
0
    private void lookAtEnemy()
    {
        // player1 stop moving
        fc1.doNotMove();

        // player2 stop moving
        fc2.doNotMove();

        // target is enemy, look at it
        Vector3 enemyPosition = new Vector3(planet_pos.x, 0.0f, planet_pos.z);

        fc1.transform.LookAt(enemyPosition, new Vector3(0, 1, 0));
        fc2.transform.LookAt(enemyPosition, new Vector3(0, 1, 0));
    }