Exemple #1
0
    public static string getArmDescription(Arm arm, ArmAspect armAspect)
    {
        string armAspectLetter = "";

        switch (armAspect)
        {
        case ArmAspect.NORMAL:
        default:
            armAspectLetter = "";
            break;

        case ArmAspect.SILVER:
            armAspectLetter = "_S";
            break;

        case ArmAspect.GOLD:
            armAspectLetter = "_G";
            break;
        }

        TextScript.Sentence armName = (TextScript.Sentence)
                                      System.Enum.Parse(typeof(TextScript.Sentence), "ARM" + (int)arm, true);

        TextScript.Sentence armDescription = (TextScript.Sentence)
                                             System.Enum.Parse(typeof(TextScript.Sentence), "ARM" + (int)arm + "_DESC" + armAspectLetter, true);

        return("<b>" + TextScript.get(armName) + "</b>\n\n" + TextScript.get(armDescription));
    }
Exemple #2
0
    void assignSingleArm(Transform tr, Arm arm, Side side, ArmAspect armAspect)
    {
        GameObject armBase = getArmBase(arm);
        GameObject armObj  = Instantiate(armBase);

        armObj.transform.SetParent(tr);
        Transform armTr     = armObj.GetComponent <RectTransform>();
        Transform armBaseTr = armBase.GetComponent <RectTransform>();

        armTr.localScale    = armBaseTr.localScale;
        armTr.localPosition = armBaseTr.localPosition;
        fixVerticalArmPosition(armTr, arm, side);

        applyArmAspect(armTr, armAspect, arm);

        // Left arms have default positions/rotations, so stop
        if (side == Side.LEFT || side == Side.UPPER_LEFT || side == Side.LOWER_LEFT)
        {
            return;
        }

        Model armModel = getModel(arm);

        fixRightArmPosition(armTr, armModel);
    }
Exemple #3
0
    void applyArmAspect(Transform armTr, ArmAspect armAspect, Arm arm)
    {
        Material   aspectMaterial;
        GameObject aspectParticleSystem;

        // Choose material & particle system to apply (stop if normal)
        switch (armAspect)
        {
        case ArmAspect.NORMAL:
        default:
            return;

        case ArmAspect.SILVER:
            aspectMaterial       = silverMaterial;
            aspectParticleSystem = particleSilver;
            break;

        case ArmAspect.GOLD:
            aspectMaterial       = goldMaterial;
            aspectParticleSystem = particleGold;
            break;
        }

        // Apply particle system
        Transform handTr           = findGrandchild(armTr, "Hand");
        Transform particleSystemTr = Instantiate(aspectParticleSystem).transform;

        particleSystemTr.SetParent(handTr);
        particleSystemTr.localPosition = Vector3.zero;
        particleSystemTr.localScale    = Vector3.one;

        // Special cases
        if (armAspect == ArmAspect.SILVER && arm == Arm.BUZZSAW)
        {
            foreach (Image img in armTr.GetComponentsInChildren <Image>())
            {
                img.color = new Color(0.53f, 1, 1, 1);
            }
            return;
        }
        if (armAspect == ArmAspect.SILVER && arm == Arm.CARTILAGE)
        {
            foreach (Image img in armTr.GetComponentsInChildren <Image>())
            {
                img.color = new Color(0.66f, 0.85f, 0.95f, 1);
            }
            return;
        }

        // Apply chosen material
        foreach (Image img in armTr.GetComponentsInChildren <Image>())
        {
            img.material = aspectMaterial;
        }
    }