示例#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
 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);
     }
 }
 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
 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
    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
    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));
 }