void SpawnFriendSlot()
    {
        Vector3 startPos = Vector3.zero;
        float   radiusX  = GlobalSpiralMaster.GetCurrentRadius(0f, ref GlobalSpiralMaster.RadiusMapX);
        float   radiusY  = GlobalSpiralMaster.GetCurrentRadius(0f, ref GlobalSpiralMaster.RadiusMapY);

        SpiralMath.GetPositionAt(0f, ref startPos, radiusX, radiusY, GlobalSpiralMaster.ScaleZ, GlobalSpiralMaster.NoiseOn);
        startPos += GlobalSpiralMaster.transform.position;

        FriendSlot friendSlot = GlobalGameState.UIPoolManager.GetPoolableObject() as FriendSlot;

        if (friendSlot == null)
        {
            Debug.LogError("FAILED: Getting poolable friend slot object.");
            return;
        }

        // Init the slot
        if (_playerID < 0) // temp fix for TGC iPhone demo to make it circular access
        {
            _playerID = 0;
        }
        friendSlot.Activate();
        friendSlot.Init(ref startPos, 0f, PlayersJSON.Players[_playerID].NetworkMode, PlayersJSON.Players[_playerID].Name);
        _friendSlots.Add(friendSlot);
        _playerID++;
    }
 public void OnFriendlistExit()
 {
     GlobalSpiralMaster.OnFriendlistExit();
     for (int i = 0; i < _friendSlots.Count; i++)
     {
         _friendSlots[i].OnFriendlistExit();
     }
     ResetPlayerID();
 }
Exemplo n.º 3
0
 // Update is called once per frame
 void Update()
 {
     if (_animateExit)
     {
         if (GlobalSpiralMaster.GetActuralLength() > 0f)
         {
             GlobalGestureCircle.DragMotion = -0.6f;
             GlobalFriendListManager.OnFriendlistExit();
         }
         else
         {
             _animateExit = false;
             GlobalFriendListManager.ResetPlayerID();
         }
     }
 }
Exemplo n.º 4
0
    private Vector3 GetTargetPosition()
    {
        if (CurrentSlotMode == SocialDataType.SlotMode.Selected)
        {
            float radiusX = GlobalSpiralMaster.GetCurrentRadius(GlobalFriendListManager.SelectedTValue, ref GlobalSpiralMaster.RadiusMapX);
            float radiusY = GlobalSpiralMaster.GetCurrentRadius(GlobalFriendListManager.SelectedTValue, ref GlobalSpiralMaster.RadiusMapY);

            SpiralMath.GetPositionAt(GlobalFriendListManager.SelectedTValue, ref _positionOnCurve, radiusX, radiusY, GlobalSpiralMaster.ScaleZ, GlobalSpiralMaster.NoiseOn);
            return(_positionOnCurve + GlobalSpiralMaster.transform.position);
        }
        else
        {
            float radiusX = GlobalSpiralMaster.GetCurrentRadius(t, ref GlobalSpiralMaster.RadiusMapX);
            float radiusY = GlobalSpiralMaster.GetCurrentRadius(t, ref GlobalSpiralMaster.RadiusMapY);

            SpiralMath.GetPositionAt(t, ref _positionOnCurve, radiusX, radiusY, GlobalSpiralMaster.ScaleZ, GlobalSpiralMaster.NoiseOn);
            return(_positionOnCurve + GlobalSpiralMaster.transform.position);
        }
    }