Exemple #1
0
    public override void OnSuccess(int id)
    {
        base.OnSuccess(id);
        BellowAnimator.SetBool("DoWork", true);

        ++bump;
        if (bump < 4)
        {
            return;
        }

        bump = 0;

        if (OreLoad.objects.Count == 0)
        {
            return;
        }

        var ore = OreLoad.objects[0];

        OreLoad.objects.RemoveAt(0);
        Destroy(ore.gameObject);

        var steel = Instantiate(PrefabsProvider.Instance.SteelPrefab);

        //IronOutputLoad.objects.Add(steel);
        IronOutputLoad.holdingObject = steel;
        steel.transform.SetParent(IronOutputLoad.transform);
        //steel.transform.localPosition = IronOutputLoad.holdingSpots[IronOutputLoad.objects.Count].transform.localPosition;
        steel.transform.localPosition = IronOutputLoad.holdingSpot.transform.localPosition;
        steel.GetComponent <PickableObject>().alreadyUsed = false;
        QuickTimeEventManager.StopQuickTimeEventForPlayer(id);
    }
    public override void OnSuccess(int id)
    {
        base.OnSuccess(id);

        ++anvilBump;
        if (anvilBump < 4)
        {
            return;
        }

        anvilBump = 0;
        if (OutputType == PickableObject.ObjectType.pickaxe)
        {
            var wood = WoodResources.objects[0];
            WoodResources.objects.RemoveAt(0);
            Destroy(wood.gameObject);

            wood = WoodResources.objects[0];
            WoodResources.objects.RemoveAt(0);
            Destroy(wood.gameObject);

            var newObj = Instantiate(PrefabsProvider.Instance.PickaxePrefab);
            OutputPlace.holdingObject = newObj;
            newObj.transform.SetParent(OutputPlace.holdingSpot.transform);
            newObj.transform.localPosition    = Vector3.zero;
            newObj.transform.localEulerAngles = Vector3.zero;
        }
        else if (OutputType == PickableObject.ObjectType.sword)
        {
            var wood = WoodResources.objects[0];
            WoodResources.objects.RemoveAt(0);
            Destroy(wood.gameObject);

            var steel = SteelResources.objects[0];
            SteelResources.objects.RemoveAt(0);
            Destroy(steel.gameObject);

            steel = SteelResources.objects[0];
            SteelResources.objects.RemoveAt(0);
            Destroy(steel.gameObject);


            var newObj = Instantiate(PrefabsProvider.Instance.SwordPrefab);
            OutputPlace.holdingObject = newObj;
            newObj.transform.SetParent(OutputPlace.holdingSpot.transform);
            newObj.transform.localPosition    = Vector3.zero;
            newObj.transform.localEulerAngles = Vector3.zero;
        }
        audioSource.PlayOneShot(clip);
        QuickTimeEventManager.StopQuickTimeEventForPlayer(id);
        //QuickTimeEventManager.StopQuickTimeEventForPlayer((int) pc.player);
    }
Exemple #3
0
    void OnTriggerExit(Collider other)
    {
        OnFail(id);

        PlayerController pc = other.GetComponent <PlayerController>();

        if (!pc && other.transform.parent)
        {
            pc = other.transform.parent.GetComponent <PlayerController>();
        }

        if (!pc)
        {
            return;
        }

        QuickTimeEventManager.StopQuickTimeEventForPlayer((int)pc.player);
        id = -1;
    }
    public override void OnSuccess(int id)
    {
        base.OnSuccess(id);

        ++pickBumber;

        if (pickBumber < 4)
        {
            return;
        }

        pickBumber = 0;
        var newStone = Instantiate(
            MiningSlotType == PickableObject.ObjectType.ironOre
                ? PrefabsProvider.Instance.IronPrefab
                : PrefabsProvider.Instance.CoalPrefab, NewRocksSpawnTransform);
        var randPos = 20 * UnityEngine.Random.onUnitSphere;

        randPos.y = 0;
        newStone.transform.localPosition = randPos;
        AxeMineAnimator.SetBool("DoWork", true);
        QuickTimeEventManager.StopQuickTimeEventForPlayer(id);
    }