Example #1
0
    // Update is called once per frame
    void Update()
    {
        EarthBehavior earthObj = earth.GetComponent("EarthBehavior") as EarthBehavior;
        SunBehavior   sunObj   = sun.GetComponent("SunBehavior") as SunBehavior;
        MoonBehavior  moonObj  = moon.GetComponent("MoonBehavior") as MoonBehavior;

        switch (view)
        {
        // Sun View
        case 0:
            transform.position = Vector3.MoveTowards(earthObj.GetPosition(), sunObj.GetPosition(), .15f);
            transform.LookAt(sunObj.GetTransform());
            break;

        // Earth View
        case 1:
            transform.position  = earthObj.GetPosition();
            transform.position -= new Vector3(0, 0, .15f);
            transform.LookAt(earthObj.GetTransform());
            break;

        // Moon View
        case 2:
            transform.position = Vector3.MoveTowards(earthObj.GetPosition(), moonObj.GetPosition(), .15f);
            transform.LookAt(moonObj.GetTransform());
            break;

        // Top-down view
        case 3:
            transform.position = new Vector3(0, 3500, 0);
            transform.LookAt(sunObj.GetTransform());
            break;
        }
    }
Example #2
0
    //Options

    /*
     * private float angle = 1; //Start angle
     * private float frequency = 0.3f;
     * private float mult = 1;
     * private float radius = 0.4f;
     * private int count = 10;
     * private float bulletspeed = 1.5f;
     * private float angleVariation = 2f;
     */

    public CyclicPattern(SunBehavior sb)
    {
        this.sb = sb;
    }
Example #3
0
    //Options

    /*
     * public float frequency = 0.3f;//frequency create helixes
     * private float angle = 90;//Start angle
     * private float radius = 0.4f;//influence separation between the projectiles
     * private float bulletSpeed = 1.5f;
     * private float rotatingSpeed = 20f;
     * private float changeDirection = 3f;//change direction after this time
     * private bool repeatChangeDirection = true;
     * private float maxRadius = 5f;//Size of helix
     * private int numberHelixes = 4;
     */

    public RotationPattern(SunBehavior sb)
    {
        this.sb = sb;
        bullets = new List <GameObject>();
    }
Example #4
0
    //Options

    /*
     * public float frequency = 0.5f;
     * public int angleAdd = 360;//180 is cool
     * public float angle = 0;//start angle
     * public float radius = 0.4f;
     * public int count = 20;
     * public float bulletspeed = 0.5f;
     * public float multiplicatorSpeed = 1f;//fait varier les vitesses pour type proj 0 et type proj 1, 1.1f ou 10f => interessant, peut inverser avec bulletspeed
     * private bool angleWillVariateExtern = true;
     * private float angleVariationExtern = 2f;
     * public bool angleWillVariateIntern = true;
     * public bool chaosOn = false;
     * public int forceAType = -1;//-1 no forcing, otherwise index
     */

    public WavePattern(SunBehavior sb)
    {
        this.sb = sb;
    }
Example #5
0
 private void Awake()
 {
     Instance = this;
 }
Example #6
0
 public LaserPattern(SunBehavior sb)
 {
     this.sb = sb;
 }