Skip to content
Snippets Groups Projects
Commit b5540420 authored by Ryan Hoppe (rmh898)'s avatar Ryan Hoppe (rmh898)
Browse files

sword

parent 49fc850c
No related branches found
No related tags found
No related merge requests found
using UnityEngine;
using System.Collections;
public class RandomSword : MonoBehaviour
{
public Sprite sword1;
public Sprite sword2;
public Sprite sword3;
public Sprite axe1;
//public Sprite axe2;
public Sprite axe3;
SpriteRenderer sr;
// sets random weapon (sword/axe) purely costmetic, doesn't affect stats.
void Start()
{
sr = GetComponent<SpriteRenderer>();
int x = Random.Range(1, 5);
if (x == 1) sr.sprite = sword1;
if (x == 2)
{
sr.sprite = sword2;
sr.flipY = true;
}
if (x == 3) sr.sprite = sword3;
if (x == 4) sr.sprite = axe1;
if (x == 5) sr.sprite = axe3;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment