Optimize Unity Code