コード例 #1
0
 private void OnMouseUp()
 {
     if (replace == true)
     {
         Destroy(collidedStaff);
         replace = false;
     }
     //hover over other objects
     mouseHold         = false;
     sr.sortingOrder  -= 3;
     sr2.sortingOrder -= 3;
     sr3.sortingOrder -= 3;
     if (!onTarget)
     {
         //back to initial pos
         transform.position   = new Vector2(initialPosition.x, initialPosition.y);
         transform.localScale = startSize;
     }
     else
     {
         ac.PlaySFX(0, ac.lo_vol);
         //new position
         transform.position   = targetObject.transform.position;
         transform.localScale = startSize;
         locked = true;
         biggerCollider.enabled  = false;
         smallerCollider.enabled = true;
         //make new one
         Instantiate(selfPrefab, initialPosition, Quaternion.identity);
     }
 }
コード例 #2
0
 private void OnMouseUp()
 {
     if (replace == true)
     {
         Destroy(collidedStaff);
         replace = false;
     }
     mouseHold         = false;
     sr.sortingOrder  -= 3;
     sr2.sortingOrder -= 3;
     sr3.sortingOrder -= 3;
     if (!onTarget)
     {
         transform.position   = new Vector2(initialPosition.x, initialPosition.y);
         transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
     }
     else
     {
         ac.PlaySFX(0, ac.lo_vol);
         transform.position   = targetObject.transform.position;
         transform.localScale = new Vector3(0.5f, 0.5f, 0.5f);
         locked = true;
         firstCollider.enabled  = false;
         secondCollider.enabled = true;
         Instantiate(selfPrefab, initialPosition, Quaternion.identity);
     }
 }
コード例 #3
0
 void Start()
 {
     db = FindObjectOfType <Database>();
     ac = FindObjectOfType <AudioControls>();
     moneyEarned.text = "You Have Earned " + db.projectCash + "$";
     daySpent.text    = "Project Finished with " + db.allDaySpent + " Days";
     ac.PlaySFX(4, ac.lo_vol);
 }
コード例 #4
0
 void Start()
 {
     db            = FindObjectOfType <Database>();
     ac            = FindObjectOfType <AudioControls>();
     dayText.text  = "Day\n" + db.dayCounter + " / 30";
     cashText.text = "Project Budget\n" + db.projectCash + " $";
     ac.StopBGM(0);
     ac.StopBGM(1);
     ac.PlaySFX(5, ac.lo_vol);
 }
コード例 #5
0
    public IEnumerator Type(int sentence_idx)
    {
        if (sentence_idx == 0)
        {
            dialogueVers = 0;
        }
        else if (db.rollResult[sentence_idx - 1] <= 9)
        {
            //problem
            if (db.rollResult[sentence_idx - 1] <= 5)
            {
                dialogueVers = 3;
            }
            else
            {
                dialogueVers = 4;
            }
        }
        else if (db.rollResult[sentence_idx - 1] > 9)
        {
            //no problem
            if (db.rollResult[sentence_idx - 1] <= 20)
            {
                dialogueVers = 1;
            }
            else
            {
                dialogueVers = 2;
            }
        }

        if (sentence_idx != 0 && db.currentBackLog[db.CurrentPostwMark[sentence_idx - 1]] <= 0)
        {
            dialogueVers = Random.Range(5, 7);
        }

        if (sentence_idx != 0 && db.staffTasks[sentence_idx - 1] <= 0)
        {
            dialogueVers = Random.Range(7, 10);
        }


        dialogueText.text = "";
        ac.PlaySFX(3, ac.med_vol);
        foreach (char letter in sentences[dialogueVers].ToCharArray())
        {
            dialogueText.text += letter;
            yield return(new WaitForSeconds(typingSpd));
        }
        ac.StopSFX(3);
        doneTalking = true;
    }
コード例 #6
0
 void Start()
 {
     totalSprints = 0;
     getProjectName();
     getTotalManHour();
     getSprintHour();
     getProjectCash();
     db           = FindObjectOfType <Database>();
     ac           = FindObjectOfType <AudioControls>();
     db.firstTime = true;
     ac.PlaySFX(2, ac.lo_vol);
     SaveVars();
 }
コード例 #7
0
 public void LoadScene(int sceneNumber)
 {
     ac.PlaySFX(1, ac.med_vol);
     SceneManager.LoadScene(sceneNumber);
 }
コード例 #8
0
    private void OnMouseUp()
    {
        if (db.isViewing == false)
        {
            //post is clicked to be seen
            if (gameObject.transform.position.x - initialPosition.x < 0.3f &&
                gameObject.transform.position.x - initialPosition.x > -0.3f &&
                gameObject.transform.position.y - initialPosition.y < 0.3f &&
                gameObject.transform.position.y - initialPosition.y > -0.3f)
            //if (gameObject.transform.position.x == initialPosition.x && gameObject.transform.position.y == initialPosition.y)
            {
                db.isViewing = true;
                frameProgress.SetActive(true);

                progProbSee = FindObjectOfType <ProgressionPanel>();
                progProbSee.totalAlreadyCleared = db.mirrorBackLog[indexPost] - db.currentBackLog[indexPost];
                progProbSee.totalManHour        = db.mirrorBackLog[indexPost];
                progProbSee.idxTask             = indexPost;
                progProbSee.idxWorker           = db.assignedBackLog[indexPost];

                if (progProbSee.isProgress == false)
                {
                    progProbSee.totalCleared = progProbSee.totalAlreadyCleared;
                }

                for (int i = 0; i < db.CurrentPostwMark.Length; i++)
                {
                    if (indexPost == db.CurrentPostwMark[i])
                    {
                        if (db.rollResult[i] > 9)
                        {
                            progProbSee.status = "On Progress";
                        }
                        else if (db.rollResult[i] <= 9)
                        {
                            progProbSee.status     = "Obstacle";
                            progProbSee.idxProblem = db.rollResult[i];
                        }
                        else
                        {
                            progProbSee.status = "Done or Not Worked yet";
                        }
                    }
                }
            }
            if (db.doneScan == false)
            {
                //hover over other objects
                sr.sortingOrder  -= 3;
                sr2.sortingOrder -= 3;
                if (!onTarget || stacking == true)
                {
                    ac.PlaySFX(0, ac.lo_vol);
                    //back to initial pos
                    transform.position   = new Vector2(initialPosition.x, initialPosition.y);
                    transform.localScale = startSize;
                }
                else
                {
                    ac.PlaySFX(0, ac.lo_vol);
                    //new position
                    transform.position   = targetObject.transform.position;
                    transform.localScale = startSize;
                }
            }
        }
    }