Beispiel #1
0
    void Start()
    {
        ring                   = GameObject.Find("ring");
        turnController         = GameObject.Find("TurnController").GetComponent <m_TurnController>();
        shooter                = GameObject.Find("Shooter").GetComponent <m_Shooter>();
        thisAudio              = GetComponent <AudioSource>();
        currentLocalBallsCount = currentRemoteBallsCount = startBallsCount;

        ResetData();
        FetchPlayerNames();


        if (PhotonNetwork.isMasterClient)
        {
            RandomPos = GetRandomPosInCollider();
            photonView.RPC("AssignRandomValue", PhotonTargets.All, RandomPos);
        }
    }
Beispiel #2
0
    void Awake()
    {
        SpawnedObjects = new GameObject("SpawnedObjects");
        GameObject dots = new GameObject("Dots");

        dots.transform.parent = SpawnedObjects.transform;
        trajectoryPoints      = new List <GameObject>();
        isPressed             = isBallThrown = false;
        for (int i = 0; i < aimDotsNum; i++)
        {
            GameObject dot = Instantiate(TrajectoryPointPrefab);
            dot.transform.parent = dots.transform;
            dot.GetComponent <Renderer>().enabled = false;
            trajectoryPoints.Insert(i, dot);
        }
        Balls          = new List <GameObject>();
        colPair        = new ClothSphereColliderPair[5];
        turnController = GameObject.Find("TurnController").GetComponent <m_TurnController>();
    }