コード例 #1
0
    public override void Interract(Tool.ToolType heldTool, float deltaTime)
    {
        if (Tutorial)
        {
        }
        if (heldTool == Tool.ToolType.Wrench)
        {
            health += repairSpeed * Time.deltaTime;

            if (health > 200f)
            {
                Working = true;
                health  = 200f;
                healthBar.GetComponent <SpriteRenderer>().color = Color.green;
            }

            Vector2 scale = healthBar.transform.localScale;
            scale.x = health / 100;
            healthBar.transform.localScale = scale;
        }
        else if (heldTool == Tool.ToolType.FireExtinguisher)
        {
            fireState -= exstinguishSpeed * Time.deltaTime;

            if (fireState < 0f)
            {
                fireState = 0f;
                OnFire    = false;
                Fire.SetActive(false);
            }
        }
    }
コード例 #2
0
 private void OnToolPickedUpTutorial(Tool.ToolType type, int playerNum)
 {
     if (type == ToolType.BUCKET)
     {
         bucketHeldTutorial = true;
     }
 }
コード例 #3
0
 private void OnToolDroppedTutorial(Tool.ToolType type, int playerNum)
 {
     if (type == ToolType.BUCKET)
     {
         bucketHeldTutorial = false;
     }
 }
コード例 #4
0
ファイル: Interactable.cs プロジェクト: theDoubi125/GGJ2020
 public void OnInteractionBy(Hand hand, Tool.ToolType toolType)
 {
     if (interactDelegate != null)
     {
         interactDelegate(this, hand, toolType);
     }
 }
コード例 #5
0
 private void OnToolDropped(Tool.ToolType type, int playerNum)
 {
     if (panel_type == TutorialEventController.TutorialStates.PICK_UP_TOOL_GO_TO_PATIENT && type != Tool.ToolType.DEFIBULATOR)
     {
         RemovePlayerCircle(playerNum);
     }
 }
コード例 #6
0
 public void InformToolDropped(Tool.ToolType type, bool full)
 {
     if (type == Tool.ToolType.CANISTER)
     {
         if (onToolDroppedCanister != null)
         {
             onToolDroppedCanister(0);
         }
     }
     else if ((currentIndexInReciepe != -1) && (type == RequiredToolForReciepeState(scene1ReciepeElements[currentIndexInReciepe])))
     {
         if (onToolDroppedForSurgery != null)
         {
             onToolDroppedForSurgery(type);
         }
     }
     else if (type == Tool.ToolType.BUCKET)
     {
         onBucketDropped(full);
     }
     else
     {
         if (onToolDroppedGeneral != null)
         {
             onToolDroppedGeneral(type);
         }
     }
 }
コード例 #7
0
    private void EnteringUpdate()
    {
        var t = getT(timeLastState, timeToEnter);

        if (t >= 1.0)
        {
            current_state = StepCompletePanelState.SHOWING;
            timeLastState = Time.time;
            if (panel_type == TutorialEventController.TutorialStates.PICK_UP_TOOL_GO_TO_PATIENT)
            {
                for (int i = 0; i < TutorialEventController.Instance.playerHasTool.Length; ++i)
                {
                    Tool.ToolType type      = TutorialEventController.Instance.playerHasTool[i];
                    bool          atPatient = TutorialEventController.Instance.doctorAtPatient[i];
                    if (atPatient)
                    {
                        AddPlayerCircle(i, type, true);
                    }
                    else if (type != Tool.ToolType.NONE)
                    {
                        AddPlayerCircle(i, type, false);
                    }
                }
            }
        }
        Vector3 newPos = Mathfx.Hermite(startPos, rect3posOrig, t);

        rectTrans.position = newPos;
    }
コード例 #8
0
 private void OnToolPickedUp(Tool.ToolType type, int playerNum)
 {
     if (tutorialToopPickUp)
     {
         actionButtonCanvas.SetActive(true);
     }
 }
コード例 #9
0
 public override void Interract(Tool.ToolType heldTool, float deltaTime)
 {
     if (heldTool == Tool.ToolType.FireExtinguisher)
     {
         Health += 50f * deltaTime;
     }
 }
コード例 #10
0
 private void OnInteraction(Interactable interactable, Hand hand, Tool.ToolType toolType)
 {
     if (toolType == Tool.ToolType.None)
     {
         hand.GrabObject(this);
     }
 }
コード例 #11
0
 private void OnToolPickedUp(Tool.ToolType type, int playerNum)
 {
     if (panel_type == TutorialEventController.TutorialStates.PICK_UP_TOOL_GO_TO_PATIENT && type != Tool.ToolType.DEFIBULATOR)
     {
         AddPlayerCircle(playerNum, type, false);
     }
 }
コード例 #12
0
 private void OnScalpelDroppedForSurgery(Tool.ToolType type)
 {
     if ((type == ToolType.SCALPEL) && !surgeryInitiated)
     {
         actionButtonCanvas.SetActive(true);
         actionButtonCanvas.GetComponent <BounceUpAndDown>().initiateBounce();
     }
 }
コード例 #13
0
ファイル: DroppedTool.cs プロジェクト: theDoubi125/GGJ2020
 private void OnInteraction(Interactable interactable, Hand hand, Tool.ToolType toolType)
 {
     if (toolType == Tool.ToolType.None)
     {
         hand.toolHandler.SetTool(inHandVersionPrefab);
         Destroy(gameObject);
     }
 }
コード例 #14
0
    public void OnSoakBlood(float duration)
    {
        var go = (GameObject)Instantiate(gauzeHotspotsPrefab, hotspotSpawnPos);

        go.transform.parent        = hotspotSpawnPos;
        go.transform.localPosition = Vector3.zero;
        go.transform.localRotation = Quaternion.identity;
        requiredTool = Tool.ToolType.GAUZE;
    }
コード例 #15
0
ファイル: WorkbenchZone.cs プロジェクト: theDoubi125/GGJ2020
    public void OnInteract(Interactable interactable, Hand hand, Tool.ToolType toolType)
    {
        Repairable repairable = interactable.GetComponent <Repairable>();

        if (repairable != null)
        {
            repairable.RepairWithTool(toolType);
        }
    }
コード例 #16
0
    public void OnCutPatientOpen(float duration)
    {
        var go = (GameObject)Instantiate(scalpelTrackPrefab, hotspotSpawnPos);

        go.transform.parent        = hotspotSpawnPos;
        go.transform.localPosition = Vector3.zero;
        go.transform.localRotation = Quaternion.identity;
        requiredTool = Tool.ToolType.SCALPEL;
    }
コード例 #17
0
 private void OnToolDropped(Tool.ToolType type)
 {
     if (type == ToolType.DEFIBULATOR)
     {
         if (!defibulatorUsedOnce && criticalEvent)
         {
             actionButtonCanvas.SetActive(true);
             actionButtonCanvas.GetComponent <BounceUpAndDown>().initiateBounce();
         }
     }
 }
コード例 #18
0
 private void OnInteraction(Interactable interactable, Hand hand, Tool.ToolType toolType)
 {
     if (toolType == Tool.ToolType.Wrench)
     {
         gameObject.SetActive(false);
         Transform spawned = Instantiate(toSpawn, transform.position, transform.rotation);
         spawned.localScale = transform.lossyScale;
         spawned.GetComponent <Repairable>().currentState = GetComponent <Repairable>().currentState;
         gameObject.SetActive(false);
         socket.SetActive(true);
     }
 }
コード例 #19
0
 public void InformToolPickedUp(Tool.ToolType type, int playerNum)
 {
     if (tutorialActive)
     {
         toolsHeldByDoctor[playerNum] = type;
         OnToolPickedUp(type, playerNum);
         if (type == Tool.ToolType.BUCKET)
         {
             playerHasBucket = playerNum;
         }
         if (type == Tool.ToolType.DEFIBULATOR)
         {
             playerHasDefibulator = playerNum;
         }
         playerHasTool[playerNum] = type;
     }
 }
コード例 #20
0
 private void AddPlayerCircle(int playerNum, Tool.ToolType toolType, bool check)
 {
     if (playerCircleShown[playerNum])
     {
         return;
     }
     if (current_state != StepCompletePanelState.SHOWING)
     {
         playerBuffer.Add(playerNum);
     }
     else
     {
         int i = 0;
         if (toolType == Tool.ToolType.SCALPEL)
         {
             if (circlesFilled[i] != -1)
             {
                 i = 1;
             }
         }
         else if (toolType == Tool.ToolType.GAUZE)
         {
             i = 2;
         }
         else if (toolType == Tool.ToolType.SUTURE)
         {
             i = 3;
         }
         if (i == 0 && toolType != Tool.ToolType.SCALPEL)
         {
             return;
         }
         if (check)
         {
             AudioControl.Instance.PlayAddTutorialCircle();
         }
         circlesFilled[i]                = playerNum;
         playerCircleShown[playerNum]    = true;
         playerCirclesChecked[playerNum] = check;
         playerCircles[i].GetComponent <PlayerCircle>().SetPlayerNumAndInitiateAnimation(playerNum, check);
     }
 }
コード例 #21
0
    public override void Interract(Tool.ToolType heldTool, float deltaTime)
    {
        if (Tutorial)
        {
            if (heldTool == Tool.ToolType.ElectricityKit)
            {
                health += repairSpeed * Time.deltaTime;

                if (health > 200f)
                {
                    Working = true;
                    health  = 200f;
                    healthBar.GetComponent <SpriteRenderer>().color = Color.green;
                }

                Vector2 scale = healthBar.transform.localScale;
                scale.x = health / 100;
                healthBar.transform.localScale = scale;
            }
        }
    }
コード例 #22
0
ファイル: Repairable.cs プロジェクト: theDoubi125/GGJ2020
    public void RepairWithTool(Tool.ToolType toolType)
    {
        switch (toolType)
        {
        case Tool.ToolType.Hammer:
            if (currentState == RepairState.Twisted)
            {
                SpawnVersion(RepairState.Unpainted);
                Instantiate(repairFXPrefab, transform.position, Quaternion.identity);
                SoundManagerScript.instance.PlayOneShotSound(SoundManagerScript.AudioClips.ObjectRepair);
            }
            break;

        case Tool.ToolType.BlowPipe:
            if (currentState == RepairState.Damaged)
            {
                SpawnVersion(RepairState.Unpainted);
                Instantiate(repairFXPrefab, transform.position, Quaternion.identity);
                SoundManagerScript.instance.PlayOneShotSound(SoundManagerScript.AudioClips.ObjectRepair);
            }
            break;
        }
    }
コード例 #23
0
 public Tool Get_Tool(Tool.ToolType type, int level)
 {
     return((Tool)items.OrderByDescending(x => x is Tool ? (x as Tool).Level : 0).FirstOrDefault(x => x is Tool && (x as Tool).Type == type && (x as Tool).Level >= level));
 }
コード例 #24
0
 public virtual void Interract(Tool.ToolType heldTool, float deltaTime)
 {
 }
コード例 #25
0
ファイル: Mob.cs プロジェクト: Ville1/3DSurvival
 public bool Has_Tool(Tool.ToolType type, int level)
 {
     return(Inventory.Has_Tool(type, level));
 }
コード例 #26
0
 public void OnTutorialGauze()
 {
     Instantiate(gauzeHotspotsPrefab, hotspotSpawnPos);
     requiredTool = Tool.ToolType.GAUZE;
 }
コード例 #27
0
 private void OnToolForSurgeryPickedUp(Tool.ToolType type)
 {
     actionButtonCanvas.SetActive(true);
     actionButtonCanvas.GetComponent <BounceUpAndDown>().initiateBounce();
 }
コード例 #28
0
 private void OnToolForSurgeryDropped(Tool.ToolType type)
 {
     actionButtonCanvas.SetActive(false);
 }
コード例 #29
0
 public void InformToolDropped(Tool.ToolType type, int playerNum)
 {
     toolsHeldByDoctor[playerNum] = Tool.ToolType.NONE;
     OnToolDropped(type, playerNum);
     playerHasTool[playerNum] = Tool.ToolType.NONE;
 }
コード例 #30
0
 public bool Has_Tool(Tool.ToolType type, int level)
 {
     return(items.Exists(x => x is Tool && (x as Tool).Type == type && (x as Tool).Level >= level));
 }