コード例 #1
0
 public void lightDeactivate(bodyPart part)
 {
     Light[] light = new Light[] { };
     if (lightDictionary.TryGetValue(part, out light))
     {
         lightDeactivate(light);
     }
 }
コード例 #2
0
 public void lightUnselect(bodyPart part)
 {
     Light[] light = new Light[] { };
     if (lightDictionary.TryGetValue(part, out light))
     {
         lightUnselect(light);
     }
 }
コード例 #3
0
    void onExplode()
    {
        // Destroy(gameObject);
        gameObject.SetActive(false);
        var t = transform;

        for (int i = 0; i < parts; i++)
        {
            t.TransformPoint(0, -100, 0);
            bodyPart clone = Instantiate(bodyPart, t.position, Quaternion.identity) as bodyPart;
            clone.GetComponent <Rigidbody2D>().AddForce(Vector3.right * Random.Range(-50, 50));
            clone.GetComponent <Rigidbody2D>().AddForce(Vector3.up * Random.Range(100, 400));
        }
        gameObject.transform.position = gameObject_with_intial_postion.transform.position;
        gameObject.SetActive(true);
        // manager.restart_position_for_pikachu();
    }
コード例 #4
0
    public void remove(bodyPart part, symptom sym)
    {
        List <symptom> tempList = new List <symptom> ();

        if (symptomsList.TryGetValue(part, out tempList))
        {
            if (tempList.Contains(sym))
            {
                symptomsList.Remove(part);
                tempList.Remove(sym);
                if (tempList.Count != 0)
                {
                    symptomsList.Add(part, tempList);
                }
            }
        }
        //else should be an error
        refresh();
    }
コード例 #5
0
    public void add(bodyPart part, symptom sym)
    {
        List <symptom> tempList = new List <symptom> ();

        if (symptomsList.TryGetValue(part, out tempList))
        {
            if (!tempList.Contains(sym))
            {
                symptomsList.Remove(part);
                tempList.Add(sym);
                symptomsList.Add(part, tempList);
            }
        }
        else
        {
            tempList = new List <symptom>()
            {
                sym
            };
            symptomsList.Add(part, tempList);
        }
        refresh();
    }
コード例 #6
0
    public void setPart(bodyPart part)
    {
        // Set current part to unselected
        // Set new part to selected
        lManag.lightSelect(part);
        lManag.lightUnselect(currentPart);

        // Store current selection list if part != currentPart
        // Load new selected Symptoms
        if (part != currentPart)
        {
            symptomToggles.Remove(currentPart);
            symptomToggles.Add(currentPart, selectedSymptoms);
            if (!symptomToggles.TryGetValue(part, out selectedSymptoms))
            {
                selectedSymptoms = new List <symptom>()
                {
                };
            }
            currentPart = part;
        }
        createList();
    }
コード例 #7
0
 public string getName(bodyPart part)
 {
     //TODO: Check for missing translation
     return(bodyTranslations[(int)currentLanguage, (int)part]);
 }