Пример #1
0
 public SuiControllerRescuing(Suicider sui, Vector2 destinationPosition) : base(sui)
 {
     m_destinationPosition = destinationPosition + Random.insideUnitCircle * 0.06f;
     sui.IsKinematic       = true;
     sui.Dude.SetBobyPartsKinematic(true);
     // This also looks cool
     // sui.DudeAnimator.Walk();
     sui.DudeAnimator.SetupPivots();
     sui.Reset();
 }
Пример #2
0
    public SuiControllerWalkAway(Suicider sui) : base(sui)
    {
        Suiciders.Add(sui);

        float direction = m_sui.transform.position.x < 0.0f ? -1.0f : 1.0f;

        m_walker        = new Walker(sui.transform, direction, Random.Range(0.2f, 0.4f));
        sui.IsKinematic = true;
        sui.Dude.SetBobyPartsKinematic(true);
        sui.DudeAnimator.Walk();
        sui.Reset();
    }
Пример #3
0
    private void GenerateSuicider(float xCoord, float direction)
    {
        Vector3      initialPosition = new Vector3(xCoord, BridgeHeight, 0.0f);
        SuiciderRoot suiciderRoot    = m_suiciderPool.Get();

        if (suiciderRoot == null)
        {
            return;
        }

        suiciderRoot.transform.position = initialPosition;
        Suicider suicider = suiciderRoot.Suicider;

        suicider.TintColor     = ColorPalette.GetRandomColor();
        suicider.SkinTintColor = ColorPalette.GetRandomSkinColor();
        suicider.Initialize(m_waterLevel);
        suicider.SortOrder = 21;
        suicider.SetIsFemale(Random.value > 0.5f);
        suicider.SetController(new SuiControllerWalkOnBridge(suicider, initialPosition, direction, m_bridgeWalkArea));
        suicider.Reset();
    }