Ejemplo n.º 1
0
    private void MakeTemple()
    {
        GameObject  prefab = Resources.Load <GameObject>("prefabs/temple");
        GameObject  temple = Instantiate(prefab);
        ScoreAbsorb sa     = temple.AddComponent <ScoreAbsorb>();

        sa.baseValue              = 0;
        sa.startVisible           = true;
        temple.transform.parent   = templeRegion.transform;
        temple.transform.position = new Vector3(0, 0, 0);
    }
Ejemplo n.º 2
0
 private void SetAllChildren()
 {
     foreach (GameObject child in ParentChildFunctions.GetAllChildren(gameObject, true))
     {
         if (child.GetComponent <Collider>() != null)
         {
             if (ignoreRaycast)
             {
                 child.layer = LayerMask.NameToLayer("Ignore Raycast");
             }
             if (child.GetComponent <ScoreAbsorb>() == null)
             {
                 ScoreAbsorb scoreAbsorb = child.AddComponent <ScoreAbsorb>();
                 scoreAbsorb.velocityMultiplier       = velocityMultiplier;
                 scoreAbsorb.massMultiplier           = massMultiplier;
                 scoreAbsorb.chargeMultiplier         = chargeMultiplier;
                 scoreAbsorb.positiveChargeMultiplier = positiveChargeMultiplier;
                 scoreAbsorb.negativeChargeMultiplier = negativeChargeMultiplier;
                 scoreAbsorb.baseValue    = baseValue;
                 scoreAbsorb.startVisible = startVisible;
             }
         }
     }
 }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     score       = GetComponent <Text>();
     scoreAbsorb = FindObjectOfType <ScoreAbsorb>();
 }